-
Notifications
You must be signed in to change notification settings - Fork 2
313 lines (266 loc) · 13.1 KB
/
ci.yml
File metadata and controls
313 lines (266 loc) · 13.1 KB
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
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
name: "build and release"
on:
push:
tags:
- "*v*.*.*"
branches:
main
ci-testing
workflow_dispatch:
release:
types: [ created ]
jobs:
build-dweb-cli:
runs-on: ${{ matrix.platform.os }}
strategy:
fail-fast: false
matrix:
platform:
- os: ubuntu-22.04
target: x86_64-unknown-linux-gnu
os_name: linux
- os: windows-latest
target: x86_64-pc-windows-msvc
os_name: windows
- os: macos-latest
target: x86_64-apple-darwin
os_name: macos-intel
- os: macos-latest
target: aarch64-apple-darwin
os_name: macos-silicon
toolchain:
- stable
steps:
- uses: actions/checkout@v3
- name: Build dweb-cli for
uses: houseabsolute/actions-rust-cross@v0
with:
command: build
target: ${{ matrix.platform.target }}
toolchain: ${{ matrix.toolchain }}
args: --locked --release
strip: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# - name: Rename binary (linux and macos)
# run: mv target/${{ matrix.platform.target }}/release/dweb target/${{ matrix.platform.target }}/release/${{ matrix.platform.cli-bin }}
# if: matrix.platform.os_name != 'windows'
# - name: Rename binary (windows)
# run: mv target/${{ matrix.platform.target }}/release/dweb.exe target/${{ matrix.platform.target }}/release/${{ matrix.platform.cli-bin }}
# if: matrix.platform.os_name == 'windows'
# - name: Generate SHA-256
# run: shasum -a 256 target/${{ matrix.platform.target }}/release/${{ matrix.platform.cli-bin }} | cut -d ' ' -f 1 > target/${{ matrix.platform.target }}/release/${{ matrix.platform.cli-bin }}.sha256
# - name: Tag with v0.1.0 (TODO undo hack for gh-releases@v1)
# run: git tag v0.1.0 && git tag --list
# - name: Release binary and SHA-256 checksum to GitHub
# uses: softprops/action-gh-release@v1
# with:
# files: |
# target/${{ matrix.platform.target }}/release/${{ matrix.platform.cli-bin }}
# target/${{ matrix.platform.target }}/release/${{ matrix.platform.cli-bin }}.sha256
- name: Upload artifacts (Linux)
if: matrix.platform.os == 'ubuntu-22.04'
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.platform.os_name }}-dweb-cli-${{ matrix.platform.target }}
path: |
target/${{ matrix.platform.target }}/release/dweb
- name: Upload artifacts (Windows)
if: matrix.platform.os == 'windows-latest'
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.platform.os_name }}-dweb-cli-${{ matrix.platform.target }}
path: |
target/${{ matrix.platform.target }}/release/*.exe
- name: List MacOS target/${{ matrix.platform.target }}/release/
if: matrix.platform.os == 'macos-latest'
run:
ls -laR target/${{ matrix.platform.target }}/release/
- name: Upload artifacts (macOS)
if: matrix.platform.os == 'macos-latest'
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.platform.os_name }}-dweb-cli-${{ matrix.platform.target }}
path: |
target/${{ matrix.platform.target }}/release/dweb
build-dweb-app:
strategy:
fail-fast: false
matrix:
include:
- platform: ubuntu-22.04
args: ''
target: x86_64-unknown-linux-gnu
cli-bin: dweb-linux-amd64
os_name: linux
- platform: windows-latest
args: ''
target: x86_64-pc-windows-msvc
cli-bin: dweb-amd64.exe
os_name: windows
- platform: macos-latest
args: --target x86_64-apple-darwin
target: x86_64-apple-darwin
cli-bin: dweb-darwin-amd64
os_name: macos-intel
- platform: macos-latest
args: --target aarch64-apple-darwin
target: aarch64-apple-darwin
os_name: macos-silicon
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Install Linux dependencies
if: startsWith(matrix.platform, 'ubuntu')
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf \
libgl1-mesa-dev libgles2-mesa-dev libegl1-mesa-dev
- name: Install frontend dependencies
run:
cd dweb-app &&
npm install
# - name: Import Apple Developer Certificate
# if: matrix.platform == 'macos-latest'
# env:
# APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
# APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
# KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
# run: |
# echo $APPLE_CERTIFICATE | base64 --decode > certificate.p12
# security create-keychain -p "$KEYCHAIN_PASSWORD" build.keychain
# security default-keychain -s build.keychain
# security unlock-keychain -p "$KEYCHAIN_PASSWORD" build.keychain
# security set-keychain-settings -t 3600 -u build.keychain
# security import certificate.p12 -k build.keychain -P "$APPLE_CERTIFICATE_PASSWORD" -T /usr/bin/codesign
# security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "$KEYCHAIN_PASSWORD" build.keychain
# security find-identity -v -p codesigning build.keychain
# - name: Verify Certificate
# if: matrix.platform == 'macos-latest'
# run: |
# CERT_INFO=$(security find-identity -v -p codesigning build.keychain | grep "Apple Development")
# CERT_ID=$(echo "$CERT_INFO" | awk -F'"' '{print $2}')
# echo "CERT_ID=$CERT_ID" >> $GITHUB_ENV
# echo "Certificate imported."
- name: Build Tauri app
run:
cd dweb-app &&
npm install @tauri-apps/cli@latest @tauri-apps/api@latest &&
npm run tauri build -- ${{ matrix.args }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
# APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
# APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
# APPLE_SIGNING_IDENTITY: ${{ env.CERT_ID }}
# APPLE_ID: ${{ secrets.APPLE_ID }}
# APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
# APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
- name: Upload artifacts (macOS)
if: matrix.platform == 'macos-latest'
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.os_name }}-${{ matrix.target }}
path: |
dweb-app/src-tauri/target/${{ matrix.target }}/release/bundle/dmg/*.dmg
- name: Upload artifacts (Linux)
if: startsWith(matrix.platform, 'ubuntu')
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.os_name }}-${{ matrix.target }}
path: |
dweb-app/src-tauri/target/release/bundle/deb/*.deb
dweb-app/src-tauri/target/release/bundle/appimage/*.AppImage
- name: Upload artifacts (Windows)
if: matrix.platform == 'windows-latest'
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.os_name }}-${{ matrix.target }}
path: |
dweb-app/src-tauri/target/release/*.exe
release:
needs: [ build-dweb-cli, build-dweb-app ]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Get version
id: get_version
run: |
VERSION=$(node -p "require('./dweb-app/src-tauri/tauri.conf.json').version")
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Display structure of downloaded files
run: ls -laR artifacts
- name: Create properly named assets
run: |
VERSION="${{ steps.get_version.outputs.VERSION }}"
# Create release directory
mkdir -p release-assets
# #### Tauri App
# # Windows EXE
# mkdir -p release-assets/dweb-app_${VERSION}_windows-x86_64-pc-windows-msvc
find artifacts/windows-x86_64-pc-windows-msvc -name "*.exe" -exec cp {} release-assets/dweb-app.exe \;
# macOS Intel DMG
find artifacts/macos-intel-x86_64-apple-darwin -name "*.dmg" -exec cp {} release-assets/dweb-app_${VERSION}_macos-x86_64-apple-darwin.dmg \;
# macOS Silicon DMG
find artifacts/macos-silicon-aarch64-apple-darwin -name "*.dmg" -exec cp {} release-assets/dweb-app_${VERSION}_macos-aarch64-apple-darwin.dmg \;
# Linux AppImage
find artifacts/linux-x86_64-unknown-linux-gnu -name "*.AppImage" -exec cp {} release-assets/dweb-app_${VERSION}_linux-x86_64-unknown-linux-gnu.AppImage \;
# Linux Deb
find artifacts/linux-x86_64-unknown-linux-gnu -name "*.deb" -exec cp {} release-assets/dweb-app_${VERSION}_linux-x86_64-unknown-linux-gnu.deb \;
#### dweb-cli
# Windows EXE
find artifacts/windows-dweb-cli-x86_64-pc-windows-msvc -name "*.exe" -exec cp {} release-assets/dweb.exe \;
# macOS Intel DMG
find artifacts/macos-intel-dweb-cli-x86_64-apple-darwin -name "dweb" -exec cp {} release-assets/dweb-cli_${VERSION}_macos-x86_64-apple-darwin.dmg \;
# macOS Silicon DMG
find artifacts/macos-silicon-dweb-cli-aarch64-apple-darwin -name "dweb" -exec cp {} release-assets/dweb-cli_${VERSION}_macos-aarch64-apple-darwin.dmg \;
# Linux Executable
find artifacts/linux-dweb-cli-x86_64-unknown-linux-gnu -name "dweb" -exec cp {} release-assets/dweb \;
# List final assets
echo "Release assets created:"
ls -la release-assets/
- name: Create Release
id: create_release
uses: softprops/action-gh-release@v2
with:
name: AutonomiDweb App and CLI v${{ steps.get_version.outputs.VERSION }}
body: |
# Download the AutonomiDweb App
## or see below for the Dweb Command Line (CLI)
### 🪟 Dweb App for Windows
- **x64 Executable**: [`dweb-app.exe`](https://github.com/${{ github.repository }}/releases/download/${{ github.ref_name }}/dweb-app.exe)
### 🍎 Dweb App for Mac
- **Intel**: [`dweb-app_${{ steps.get_version.outputs.VERSION }}_macos-x86_64-apple-darwin.dmg`](https://github.com/${{ github.repository }}/releases/download/${{ github.ref_name }}/dweb-app_${{ steps.get_version.outputs.VERSION }}_macos-x86_64-apple-darwin.dmg)
- **Apple Silicon**: [`dweb-app_${{ steps.get_version.outputs.VERSION }}_macos-aarch64-apple-darwin.dmg`](https://github.com/${{ github.repository }}/releases/download/${{ github.ref_name }}/dweb-app_${{ steps.get_version.outputs.VERSION }}_macos-aarch64-apple-darwin.dmg)
### 🐧 Dweb App for Linux
- **x64 AppImage**: [`dweb-app_${{ steps.get_version.outputs.VERSION }}_linux-x86_64-unknown-linux-gnu.AppImage`](https://github.com/${{ github.repository }}/releases/download/${{ github.ref_name }}/dweb-app_${{ steps.get_version.outputs.VERSION }}_linux-x86_64-unknown-linux-gnu.AppImage)
- **x64 Debian Package**: [`dweb-app_${{ steps.get_version.outputs.VERSION }}_linux-x86_64-unknown-linux-gnu.deb`](https://github.com/${{ github.repository }}/releases/download/${{ github.ref_name }}/dweb-app_${{ steps.get_version.outputs.VERSION }}_linux-x86_64-unknown-linux-gnu.deb)
# Download Dweb Command Line (CLI):
### 🪟 Dweb CLI for Windows
- **x64 Executable**: [`dweb.exe`](https://github.com/${{ github.repository }}/releases/download/${{ github.ref_name }}/dweb.exe)
### 🍎 Dweb CLI for Mac
- **Intel**: [`dweb-cli_${{ steps.get_version.outputs.VERSION }}_macos-x86_64-apple-darwin.dmg`](https://github.com/${{ github.repository }}/releases/download/${{ github.ref_name }}/dweb-cli_${{ steps.get_version.outputs.VERSION }}_macos-x86_64-apple-darwin.dmg)
- **Apple Silicon**: [`dweb-cli_${{ steps.get_version.outputs.VERSION }}_macos-aarch64-apple-darwin.dmg`](https://github.com/${{ github.repository }}/releases/download/${{ github.ref_name }}/dweb-cli_${{ steps.get_version.outputs.VERSION }}_macos-aarch64-apple-darwin.dmg)
### 🐧 Dweb CLI for Linux
- **x64 Executable**: [`dweb`](https://github.com/${{ github.repository }}/releases/download/${{ github.ref_name }}/dweb)
generate_release_notes: true
draft: false
prerelease: false
files: |
release-assets/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}