Release #1
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: | |
| inputs: | |
| tag: | |
| description: 'Release tag (e.g. v0.0.9)' | |
| required: false | |
| permissions: | |
| contents: write | |
| env: | |
| NODE_VERSION: '20' | |
| RUST_VERSION: 'stable' | |
| jobs: | |
| build: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - platform: macos-latest # ARM64 (Apple Silicon) | |
| target: aarch64-apple-darwin | |
| os_name: macos-arm64 | |
| - platform: macos-13 # Intel | |
| 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 }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| cache: npm | |
| - name: Setup Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: ${{ matrix.target }} | |
| - name: Rust cache | |
| uses: swatinem/rust-cache@v2 | |
| with: | |
| workspaces: src-tauri -> target | |
| key: ${{ matrix.target }} | |
| # Linux dependencies | |
| - name: Install Linux dependencies | |
| if: contains(matrix.platform, 'ubuntu') | |
| 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 | |
| # macOS: Import signing certificate | |
| - name: Import Apple certificate | |
| if: contains(matrix.platform, 'macos') | |
| env: | |
| APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }} | |
| APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }} | |
| KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }} | |
| run: | | |
| CERTIFICATE_PATH=$RUNNER_TEMP/certificate.p12 | |
| KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db | |
| echo -n "$APPLE_CERTIFICATE" | base64 --decode -o $CERTIFICATE_PATH | |
| security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH | |
| security set-keychain-settings -lut 21600 $KEYCHAIN_PATH | |
| security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH | |
| security import $CERTIFICATE_PATH -P "$APPLE_CERTIFICATE_PASSWORD" \ | |
| -A -t cert -f pkcs12 -k $KEYCHAIN_PATH | |
| security set-key-partition-list -S apple-tool:,apple: \ | |
| -k "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH | |
| security list-keychain -d user -s $KEYCHAIN_PATH | |
| - name: Install npm dependencies | |
| run: npm ci | |
| # Build frontend | |
| - name: Build frontend | |
| run: npm run build | |
| # Build sidecar | |
| - name: Build sidecar | |
| run: npm run build:sidecar | |
| # Build Tauri app | |
| - name: Build Tauri (macOS signed) | |
| if: contains(matrix.platform, 'macos') | |
| env: | |
| TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }} | |
| TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }} | |
| 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: Build Tauri (Linux) | |
| if: contains(matrix.platform, 'ubuntu') | |
| run: | | |
| cd src-tauri && cargo tauri build --target ${{ matrix.target }} | |
| - name: Build Tauri (Windows) | |
| if: contains(matrix.platform, 'windows') | |
| run: | | |
| cd src-tauri && cargo tauri build --target ${{ matrix.target }} | |
| # macOS: Notarize | |
| - name: Notarize macOS DMG | |
| if: contains(matrix.platform, 'macos') | |
| 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" | head -1) | |
| if [ -n "$DMG" ]; then | |
| echo "Notarizing: $DMG" | |
| xcrun notarytool submit "$DMG" \ | |
| --apple-id "$APPLE_ID" \ | |
| --password "$APPLE_PASSWORD" \ | |
| --team-id "$APPLE_TEAM_ID" \ | |
| --wait | |
| xcrun stapler staple "$DMG" | |
| fi | |
| # Upload artifacts | |
| - name: Upload macOS artifacts | |
| if: contains(matrix.platform, 'macos') | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ValeDesk-${{ matrix.os_name }} | |
| path: | | |
| src-tauri/target/${{ matrix.target }}/release/bundle/dmg/*.dmg | |
| - name: Upload Linux artifacts | |
| if: contains(matrix.platform, 'ubuntu') | |
| 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 | |
| - name: Upload Windows artifacts | |
| if: contains(matrix.platform, '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 | |
| # Create GitHub Release | |
| release: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| steps: | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: artifacts | |
| - name: List artifacts | |
| run: find artifacts -type f | sort | |
| - name: Create Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| draft: true | |
| generate_release_notes: true | |
| files: | | |
| artifacts/**/*.dmg | |
| artifacts/**/*.AppImage | |
| artifacts/**/*.deb | |
| artifacts/**/*.msi | |
| artifacts/**/*.exe |