This repository has been archived by the owner on Sep 2, 2024. It is now read-only.
forked from getAlby/nostr-wallet-connect
-
Notifications
You must be signed in to change notification settings - Fork 3
188 lines (160 loc) · 7.23 KB
/
wails2.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
name: Wails build - all platforms
on:
push:
jobs:
build:
strategy:
fail-fast: false
matrix:
build: [
{name: albyhub, platform: linux/amd64, os: ubuntu-20.04},
{name: albyhub, platform: windows/amd64, os: windows-2019},
{name: albyhub, platform: darwin/universal, os: macos-12}
]
runs-on: ${{ matrix.build.os }}
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
#- uses: dAppServer/[email protected]
# with:
# build-name: ${{ matrix.build.name }}
# build-platform: ${{ matrix.build.platform }}
# package: true
# go-version: '1.21'
# wails-version: 'v2.7.1'
# nsis: false
# node-version: '20.x'
- name: Install dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y patchelf
- name: Setup GoLang
uses: actions/setup-go@v5
with:
check-latest: true
go-version: 1.21
- name: Get dependencies
run: go get -v -t -d ./...
- name: Setup NodeJS
uses: actions/setup-node@v3
with:
node-version: '20.x'
- name: Install Wails
run: go install github.com/wailsapp/wails/v2/cmd/[email protected]
shell: bash
- name: Install Linux Wails deps
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install libgtk-3-0 libwebkit2gtk-4.0-dev gcc-aarch64-linux-gnu
shell: bash
- name: Install macOS Wails deps
if: runner.os == 'macOS'
run: brew install mitchellh/gon/gon
shell: bash
- name: Wails Doctor
working-directory: .
run: wails doctor
shell: bash
# On Windows, we need the shared libraries to be found in the same directory
# as the executable. Wails build will fail otherwise.
- name: Copy shared libraries
if: runner.os == 'Windows'
run: |
cp `go list -m -f "{{.Dir}}" github.com/breez/breez-sdk-go`/breez_sdk/lib/windows-amd64/breez_sdk_bindings.dll ./
cp `go list -m -f "{{.Dir}}" github.com/getAlby/glalby-go`/glalby/x86_64-pc-windows-gnu/glalby_bindings.dll ./
cp `go list -m -f "{{.Dir}}" github.com/getAlby/ldk-node-go`/ldk_node/x86_64-pc-windows-gnu/ldk_node.dll ./
shell: bash
- name: Copy appicon in place
run: mkdir -p build && cp appicon.png build
shell: bash
- name: Build App
if: runner.os == 'macOS'
run: wails build --platform darwin/universal -webview2 download -o ${{ matrix.build.name }} -tags "wails"
shell: bash
- name: Build App
if: runner.os == 'Linux'
run: wails build --platform linux/amd64 -webview2 download -o ${{ matrix.build.name }} -tags "wails"
shell: bash
- name: Build Windows App
if: runner.os == 'Windows'
run: wails build --platform windows/amd64 -webview2 download -o ${{ matrix.build.name }}.exe -tags "wails"
shell: bash
- name: Copy DLLs to the output directory
if: runner.os == 'Windows'
run: |
cp breez_sdk_bindings.dll ./build/bin/
cp glalby_bindings.dll ./build/bin/
cp ldk_node.dll ./build/bin/
shell: bash
- name: Copy shared libraries to the output directory and adjust directory structure
if: runner.os == 'Linux'
run: |
mkdir -p ./build/bin/albyhub-${{runner.os}}/lib
cp `go list -m -f "{{.Dir}}" github.com/breez/breez-sdk-go`/breez_sdk/lib/linux-amd64/libbreez_sdk_bindings.so ./build/bin/albyhub-${{runner.os}}/lib/
cp `go list -m -f "{{.Dir}}" github.com/getAlby/glalby-go`/glalby/x86_64-unknown-linux-gnu/libglalby_bindings.so ./build/bin/albyhub-${{runner.os}}/lib/
cp `go list -m -f "{{.Dir}}" github.com/getAlby/ldk-node-go`/ldk_node/x86_64-unknown-linux-gnu/libldk_node.so ./build/bin/albyhub-${{runner.os}}/lib/
mkdir -p ./build/bin/albyhub-${{runner.os}}/bin
mv ./build/bin/${{ matrix.build.name }} ./build/bin/albyhub-${{runner.os}}/bin/
shell: bash
- name: Patch executable RPATH
if: runner.os == 'Linux'
run: |
patchelf --force-rpath --set-rpath '$ORIGIN/../lib' ./build/bin/albyhub-${{runner.os}}/bin/${{ matrix.build.name }}
- name: Copy shared libraries to the output directory
if: runner.os == 'macOS'
run: |
mkdir -p ./build/bin/${{ matrix.build.name }}.app/Contents/Frameworks
lipo -create -output ./build/bin/${{ matrix.build.name }}.app/Contents/Frameworks/libbreez_sdk_bindings.dylib `go list -m -f "{{.Dir}}" github.com/breez/breez-sdk-go`/breez_sdk/lib/darwin-aarch64/libbreez_sdk_bindings.dylib `go list -m -f "{{.Dir}}" github.com/breez/breez-sdk-go`/breez_sdk/lib/darwin-amd64/libbreez_sdk_bindings.dylib
cp `go list -m -f "{{.Dir}}" github.com/getAlby/glalby-go`/glalby/universal-macos/libglalby_bindings.dylib ./build/bin/${{ matrix.build.name }}.app/Contents/Frameworks/
cp `go list -m -f "{{.Dir}}" github.com/getAlby/ldk-node-go`/ldk_node/universal-macos/libldk_node.dylib ./build/bin/${{ matrix.build.name }}.app/Contents/Frameworks/
shell: bash
- name: Patch executable RPATH
if: runner.os == 'macOS'
run: |
install_name_tool -add_rpath @executable_path/../Frameworks ./build/bin/${{ matrix.build.name }}.app/Contents/MacOS/${{ matrix.build.name }}
- name: Add macOS perms
if: runner.os == 'macOS'
run: chmod +x build/bin/${{ matrix.build.name }}.app/Contents/MacOS/${{ matrix.build.name }}
shell: bash
- name: Add Linux perms
if: runner.os == 'Linux'
run: chmod +x build/bin/albyhub-${{runner.os}}/bin/${{ matrix.build.name }}
shell: bash
# Store everything in a tar archive to preserve permissions
# (specifically, the executable bit on the app executable).
- name: Make output tar archive
if: runner.os == 'Linux'
run: |
mkdir -p ./build/out
tar -cjf ./build/out/albyhub-${{runner.os}}.tar.bz2 -C ./build/bin .
rm -Rf ./build/bin/*
mv ./build/out/albyhub-${{runner.os}}.tar.bz2 ./build/bin/
- name: Make DMG image for macOS
if: runner.os == 'macOS'
run: |
mkdir -p ./build/out
hdiutil create -volname "AlbyHub" -srcfolder ./build/bin/${{ matrix.build.name }}.app -ov -format UDZO ./build/out/albyhub-${{runner.os}}.dmg
rm -Rf ./build/bin/*
mv ./build/out/albyhub-${{runner.os}}.dmg ./build/bin/
- uses: actions/upload-artifact@v4
if: runner.os == 'Linux'
with:
name: albyhub-${{runner.os}}
path: |
./build/bin/albyhub-${{runner.os}}.tar.bz2
if-no-files-found: error
- uses: actions/upload-artifact@v4
if: runner.os == 'macOS'
with:
name: albyhub-${{runner.os}}
path: |
./build/bin/albyhub-${{runner.os}}.dmg
if-no-files-found: error
- uses: actions/upload-artifact@v4
if: runner.os == 'Windows'
with:
name: albyhub-${{runner.os}}
path: |
*\bin\*
if-no-files-found: error