feat: Update release workflow and tauri configuration script for vers… #59
Workflow file for this run
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: "Publish" | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| workflow_dispatch: {} | |
| jobs: | |
| publish-tauri: | |
| permissions: | |
| contents: write | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - platform: "windows-latest" | |
| args: "" | |
| os-name: "windows" | |
| - platform: "ubuntu-22.04" | |
| args: "" | |
| os-name: "linux" | |
| runs-on: ${{ matrix.platform }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: Validate tag format | |
| shell: bash | |
| run: | | |
| TAG="${GITHUB_REF_NAME}" | |
| if [[ ! "$TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+([\-+].*)?$ ]]; then | |
| echo "Invalid tag: $TAG" | |
| exit 1 | |
| fi | |
| - name: Setup Linux dependencies | |
| if: matrix.platform == 'ubuntu-22.04' | |
| uses: ./.github/actions/setup-linux-deps | |
| with: | |
| extra-packages: "libfuse2 libappindicator3-dev patchelf" | |
| - name: Fix linuxdeploy permissions | |
| if: matrix.platform == 'ubuntu-22.04' | |
| run: chmod +x ./src-tauri/target/release/bundle/appimage/linuxdeploy-*.AppImage || true | |
| - name: Unset problematic env vars | |
| if: matrix.platform == 'ubuntu-22.04' | |
| run: | | |
| unset GTK_PATH | |
| unset LD_LIBRARY_PATH | |
| - name: Setup Node.js | |
| uses: ./.github/actions/setup-node | |
| with: | |
| setup-safe-chain: false | |
| - name: Setup Rust | |
| uses: ./.github/actions/setup-rust | |
| with: | |
| components: "" | |
| - name: Generate licenses.json | |
| run: npx license-checker --production --json > licenses.json | |
| - name: Check licenses | |
| run: node --experimental-strip-types .github/scripts/check-licenses.ts licenses.json | |
| - name: Update tauri.conf.json using Node.js script | |
| shell: bash | |
| run: | | |
| TAG="${GITHUB_REF_NAME}" # v1.x.x | |
| VERSION="${TAG#v}" # 1.x.x | |
| node .github/scripts/updateTauriConfig.cjs \ | |
| --version "$VERSION" \ | |
| --sign "trusted-signing-cli -e https://eus.codesigning.azure.net/ -a hardware-monitor -c hv-certificate %1" | |
| - name: Setup Azure Code Signing | |
| run: cargo install trusted-signing-cli | |
| # Generate THIRD_PARTY_LICENSES file | |
| # Generate here to include in Tauri build bundle | |
| - name: Install cargo-license | |
| run: cargo install cargo-license | |
| - name: Generate THIRD_PARTY_NOTICES | |
| run: node --experimental-strip-types .github/scripts/generate-licenses.ts tmp | |
| - uses: tauri-apps/tauri-action@19b93bb55601e3e373a93cfb6eb4242e45f5af20 # v0.6.0 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }} | |
| AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }} | |
| AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }} | |
| TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }} | |
| TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }} | |
| with: | |
| tagName: v__VERSION__ # the action automatically replaces \_\_VERSION\_\_ with the app version. | |
| releaseName: "v__VERSION__" | |
| releaseDraft: true | |
| prerelease: false | |
| args: ${{ matrix.args }} | |
| - if: ${{ matrix.platform == 'windows-latest' }} | |
| name: Bundle Offline Installer | |
| env: | |
| AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }} | |
| AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }} | |
| AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }} | |
| TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }} | |
| TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }} | |
| run: npm run tauri bundle -- --config src-tauri/tauri.microsoftstore.conf.json | |
| shell: bash | |
| - if: ${{ matrix.platform == 'windows-latest' }} | |
| name: Rename Offline Installer | |
| run: | | |
| mkdir -p dist/offline | |
| cp src-tauri/target/release/bundle/msi/*.msi "dist/offline/HardwareVisualizer_${VERSION}_x64_en-US_offline.msi" | |
| - if: ${{ matrix.platform == 'windows-latest' }} | |
| name: Upload MSI via gh CLI | |
| run: gh release upload "${{ github.ref_name }}" dist/offline/*.msi | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| shell: bash | |
| - name: Upload THIRD_PARTY_NOTICES.md | |
| run: | | |
| mv ./tmp/THIRD_PARTY_NOTICES.md ./tmp/THIRD_PARTY_NOTICES_${{ matrix.os-name }}.md | |
| gh release upload "${{ github.ref_name }}" ./tmp/THIRD_PARTY_NOTICES_${{ matrix.os-name }}.md | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| shell: bash |