@@ -3,30 +3,25 @@ name: Release
33on :
44 push :
55 tags :
6- - ' v* '
6+ - " v* "
77 workflow_dispatch :
8- inputs :
9- tag :
10- description : ' Release tag (e.g. v0.0.9)'
11- required : false
128
139permissions :
1410 contents : write
1511
1612env :
17- NODE_VERSION : ' 20'
18- RUST_VERSION : ' stable'
13+ NODE_VERSION : " 20"
1914
2015jobs :
2116 build :
2217 strategy :
2318 fail-fast : false
2419 matrix :
2520 include :
26- - platform : macos-latest # ARM64 (Apple Silicon)
21+ - platform : macos-latest
2722 target : aarch64-apple-darwin
2823 os_name : macos-arm64
29- - platform : macos-13 # Intel
24+ - platform : macos-13
3025 target : x86_64-apple-darwin
3126 os_name : macos-x64
3227 - platform : ubuntu-22.04
@@ -38,162 +33,120 @@ jobs:
3833
3934 runs-on : ${{ matrix.platform }}
4035 steps :
41- - name : Checkout
42- uses : actions/checkout@v4
36+ - uses : actions/checkout@v4
4337
44- - name : Setup Node.js
45- uses : actions/setup-node@v4
38+ - uses : actions/setup-node@v4
4639 with :
4740 node-version : ${{ env.NODE_VERSION }}
4841 cache : npm
4942
50- - name : Setup Rust
51- uses : dtolnay/rust-toolchain@stable
43+ - uses : dtolnay/rust-toolchain@stable
5244 with :
5345 targets : ${{ matrix.target }}
5446
55- - name : Rust cache
56- uses : swatinem/rust-cache@v2
47+ - uses : swatinem/rust-cache@v2
5748 with :
5849 workspaces : src-tauri -> target
5950 key : ${{ matrix.target }}
6051
6152 - name : Install Tauri CLI
6253 run : cargo install tauri-cli --locked
6354
64- # Linux dependencies
65- - name : Install Linux dependencies
66- if : contains(matrix.platform, 'ubuntu')
55+ - name : Install Linux deps
56+ if : runner.os == 'Linux'
6757 run : |
6858 sudo apt-get update
6959 sudo apt-get install -y \
70- libwebkit2gtk-4.1-dev \
71- libappindicator3-dev \
72- librsvg2-dev \
73- patchelf \
74- libgtk-3-dev \
75- libsoup-3.0-dev \
76- libjavascriptcoregtk-4.1-dev
77-
78- # macOS: Import signing certificate (skip if secrets not configured)
60+ libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev \
61+ patchelf libgtk-3-dev libsoup-3.0-dev libjavascriptcoregtk-4.1-dev
62+
7963 - name : Import Apple certificate
80- if : contains(matrix.platform, 'macos') && env .APPLE_CERTIFICATE != ''
64+ if : runner.os == 'macOS' && secrets .APPLE_CERTIFICATE != ''
8165 env :
8266 APPLE_CERTIFICATE : ${{ secrets.APPLE_CERTIFICATE }}
8367 APPLE_CERTIFICATE_PASSWORD : ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
8468 KEYCHAIN_PASSWORD : ${{ secrets.KEYCHAIN_PASSWORD }}
8569 run : |
86- CERTIFICATE_PATH=$RUNNER_TEMP/certificate.p12
87- KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
88-
89- echo -n "$APPLE_CERTIFICATE" | base64 --decode -o $CERTIFICATE_PATH
90-
91- security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
92- security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
93- security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
70+ CERT=$RUNNER_TEMP/cert.p12
71+ KC=$RUNNER_TEMP/signing.keychain-db
72+ echo -n "$APPLE_CERTIFICATE" | base64 --decode -o $CERT
73+ security create-keychain -p "$KEYCHAIN_PASSWORD" $KC
74+ security set-keychain-settings -lut 21600 $KC
75+ security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KC
76+ security import $CERT -P "$APPLE_CERTIFICATE_PASSWORD" -A -t cert -f pkcs12 -k $KC
77+ security set-key-partition-list -S apple-tool:,apple: -k "$KEYCHAIN_PASSWORD" $KC
78+ security list-keychain -d user -s $KC
79+
80+ - run : npm ci
9481
95- security import $CERTIFICATE_PATH -P "$APPLE_CERTIFICATE_PASSWORD" \
96- -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
97- security set-key-partition-list -S apple-tool:,apple: \
98- -k "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
99- security list-keychain -d user -s $KEYCHAIN_PATH
100-
101- - name : Install npm dependencies
102- run : npm ci
103-
104- # Build frontend
10582 - name : Build frontend
10683 run : npm run build
10784
108- # Build sidecar
10985 - name : Build sidecar
11086 run : npm run build:sidecar
11187
112- # Build Tauri app
113- - name : Build Tauri (macOS)
114- if : contains(matrix.platform, 'macos')
88+ - name : Build Tauri
11589 env :
116- TAURI_SIGNING_PRIVATE_KEY : ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
117- TAURI_SIGNING_PRIVATE_KEY_PASSWORD : ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
118- APPLE_SIGNING_IDENTITY : ${{ secrets.APPLE_CERTIFICATE != '' && 'Developer ID Application: Valeriy Kovalsky (A933C2TJXU)' || '-' }}
90+ APPLE_SIGNING_IDENTITY : " Developer ID Application: Valeriy Kovalsky (A933C2TJXU)"
11991 APPLE_ID : ${{ secrets.APPLE_ID }}
12092 APPLE_PASSWORD : ${{ secrets.APPLE_PASSWORD }}
12193 APPLE_TEAM_ID : ${{ secrets.APPLE_TEAM_ID }}
122- run : |
123- cd src-tauri && cargo tauri build --target ${{ matrix.target }}
94+ run : cd src-tauri && cargo tauri build --target ${{ matrix.target }}
12495
125- - name : Build Tauri (Linux)
126- if : contains(matrix.platform, 'ubuntu')
127- run : |
128- cd src-tauri && cargo tauri build --target ${{ matrix.target }}
129-
130- - name : Build Tauri (Windows)
131- if : contains(matrix.platform, 'windows')
132- run : |
133- cd src-tauri && cargo tauri build --target ${{ matrix.target }}
134-
135- # macOS: Notarize (only if certificate is configured)
13696 - name : Notarize macOS DMG
137- if : contains(matrix.platform, 'macos') && secrets.APPLE_CERTIFICATE != ''
97+ if : runner.os == 'macOS' && secrets.APPLE_ID != ''
13898 env :
13999 APPLE_ID : ${{ secrets.APPLE_ID }}
140100 APPLE_PASSWORD : ${{ secrets.APPLE_PASSWORD }}
141101 APPLE_TEAM_ID : ${{ secrets.APPLE_TEAM_ID }}
142102 run : |
143- DMG=$(find src-tauri/target/${{ matrix.target }}/release/bundle/dmg -name "*.dmg" | head -1)
103+ DMG=$(find src-tauri/target/${{ matrix.target }}/release/bundle/dmg -name "*.dmg" 2>/dev/null | head -1)
144104 if [ -n "$DMG" ]; then
145- echo "Notarizing: $DMG"
146105 xcrun notarytool submit "$DMG" \
147- --apple-id "$APPLE_ID" \
148- --password "$APPLE_PASSWORD" \
149- --team-id "$APPLE_TEAM_ID" \
150- --wait
151- xcrun stapler staple "$DMG"
106+ --apple-id "$APPLE_ID" --password "$APPLE_PASSWORD" --team-id "$APPLE_TEAM_ID" --wait || true
107+ xcrun stapler staple "$DMG" || true
152108 fi
153109
154- # Upload artifacts
155110 - name : Upload macOS artifacts
156- if : contains(matrix.platform, 'macos')
111+ if : runner.os == 'macOS'
157112 uses : actions/upload-artifact@v4
158113 with :
159114 name : ValeDesk-${{ matrix.os_name }}
160- path : |
161- src-tauri/target/${{ matrix.target }}/release/bundle/dmg/*.dmg
115+ path : src-tauri/target/${{ matrix.target }}/release/bundle/dmg/*.dmg
116+ if-no-files-found : ignore
162117
163118 - name : Upload Linux artifacts
164- if : contains(matrix.platform, 'ubuntu')
119+ if : runner.os == 'Linux'
165120 uses : actions/upload-artifact@v4
166121 with :
167122 name : ValeDesk-${{ matrix.os_name }}
168123 path : |
169124 src-tauri/target/${{ matrix.target }}/release/bundle/appimage/*.AppImage
170125 src-tauri/target/${{ matrix.target }}/release/bundle/deb/*.deb
126+ if-no-files-found : ignore
171127
172128 - name : Upload Windows artifacts
173- if : contains(matrix.platform, 'windows')
129+ if : runner.os == 'Windows'
174130 uses : actions/upload-artifact@v4
175131 with :
176132 name : ValeDesk-${{ matrix.os_name }}
177133 path : |
178134 src-tauri/target/${{ matrix.target }}/release/bundle/msi/*.msi
179135 src-tauri/target/${{ matrix.target }}/release/bundle/nsis/*.exe
136+ if-no-files-found : ignore
180137
181- # Create GitHub Release
182138 release :
183139 needs : build
184140 runs-on : ubuntu-latest
185141 if : startsWith(github.ref, 'refs/tags/v')
186142 steps :
187- - name : Download all artifacts
188- uses : actions/download-artifact@v4
143+ - uses : actions/download-artifact@v4
189144 with :
190145 path : artifacts
191146
192- - name : List artifacts
193- run : find artifacts -type f | sort
147+ - run : find artifacts -type f | sort
194148
195- - name : Create Release
196- uses : softprops/action-gh-release@v2
149+ - uses : softprops/action-gh-release@v2
197150 with :
198151 draft : true
199152 generate_release_notes : true
0 commit comments