Release #8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| env: | |
| NODE_VERSION: "20" | |
| jobs: | |
| build: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - platform: macos-latest | |
| target: aarch64-apple-darwin | |
| os_name: macos-arm64 | |
| - platform: macos-13 | |
| target: x86_64-apple-darwin | |
| os_name: macos-x64 | |
| - platform: ubuntu-22.04 | |
| target: x86_64-unknown-linux-gnu | |
| os_name: linux-x64 | |
| - platform: windows-latest | |
| target: x86_64-pc-windows-msvc | |
| os_name: windows-x64 | |
| runs-on: ${{ matrix.platform }} | |
| env: | |
| HAS_CERT: ${{ secrets.APPLE_CERTIFICATE != '' }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| cache: npm | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: ${{ matrix.target }} | |
| - uses: swatinem/rust-cache@v2 | |
| with: | |
| workspaces: src-tauri -> target | |
| key: ${{ matrix.target }} | |
| - name: Install Tauri CLI | |
| run: cargo install tauri-cli --locked | |
| - name: Install Linux deps | |
| if: runner.os == 'Linux' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev \ | |
| patchelf libgtk-3-dev libsoup-3.0-dev libjavascriptcoregtk-4.1-dev | |
| - name: Import Apple certificate | |
| if: runner.os == 'macOS' && env.HAS_CERT == 'true' | |
| env: | |
| APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }} | |
| APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }} | |
| KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }} | |
| run: | | |
| CERT=$RUNNER_TEMP/cert.p12 | |
| KC=$RUNNER_TEMP/signing.keychain-db | |
| echo -n "$APPLE_CERTIFICATE" | base64 --decode -o $CERT | |
| security create-keychain -p "$KEYCHAIN_PASSWORD" $KC | |
| security set-keychain-settings -lut 21600 $KC | |
| security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KC | |
| security import $CERT -P "$APPLE_CERTIFICATE_PASSWORD" -A -t cert -f pkcs12 -k $KC | |
| security set-key-partition-list -S apple-tool:,apple: -k "$KEYCHAIN_PASSWORD" $KC | |
| security list-keychain -d user -s $KC | |
| - run: npm ci | |
| - name: Build frontend | |
| run: npm run build | |
| - name: Build sidecar | |
| run: npm run build:sidecar | |
| - name: Build Tauri | |
| env: | |
| APPLE_SIGNING_IDENTITY: "Developer ID Application: Valeriy Kovalsky (A933C2TJXU)" | |
| APPLE_ID: ${{ secrets.APPLE_ID }} | |
| APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }} | |
| APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} | |
| run: cd src-tauri && cargo tauri build --target ${{ matrix.target }} | |
| - name: Notarize macOS DMG | |
| if: runner.os == 'macOS' && env.HAS_CERT == 'true' | |
| env: | |
| APPLE_ID: ${{ secrets.APPLE_ID }} | |
| APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }} | |
| APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} | |
| run: | | |
| DMG=$(find src-tauri/target/${{ matrix.target }}/release/bundle/dmg -name "*.dmg" 2>/dev/null | head -1) | |
| if [ -n "$DMG" ]; then | |
| xcrun notarytool submit "$DMG" \ | |
| --apple-id "$APPLE_ID" --password "$APPLE_PASSWORD" --team-id "$APPLE_TEAM_ID" --wait || true | |
| xcrun stapler staple "$DMG" || true | |
| fi | |
| - name: Upload macOS artifacts | |
| if: runner.os == 'macOS' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ValeDesk-${{ matrix.os_name }} | |
| path: src-tauri/target/${{ matrix.target }}/release/bundle/dmg/*.dmg | |
| if-no-files-found: ignore | |
| - name: Upload Linux artifacts | |
| if: runner.os == 'Linux' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ValeDesk-${{ matrix.os_name }} | |
| path: | | |
| src-tauri/target/${{ matrix.target }}/release/bundle/appimage/*.AppImage | |
| src-tauri/target/${{ matrix.target }}/release/bundle/deb/*.deb | |
| if-no-files-found: ignore | |
| - name: Upload Windows artifacts | |
| if: runner.os == 'Windows' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ValeDesk-${{ matrix.os_name }} | |
| path: | | |
| src-tauri/target/${{ matrix.target }}/release/bundle/msi/*.msi | |
| src-tauri/target/${{ matrix.target }}/release/bundle/nsis/*.exe | |
| if-no-files-found: ignore | |
| release: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| steps: | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| path: artifacts | |
| - run: find artifacts -type f | sort | |
| - uses: softprops/action-gh-release@v2 | |
| with: | |
| draft: true | |
| generate_release_notes: true | |
| files: | | |
| artifacts/**/*.dmg | |
| artifacts/**/*.AppImage | |
| artifacts/**/*.deb | |
| artifacts/**/*.msi | |
| artifacts/**/*.exe |