release: v0.3.28 #31
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: Release Updater | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| build-assets: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: macos-latest | |
| target: aarch64-apple-darwin | |
| - os: macos-15-intel | |
| target: x86_64-apple-darwin | |
| - os: ubuntu-22.04 | |
| target: x86_64-unknown-linux-gnu | |
| - os: windows-latest | |
| target: x86_64-pc-windows-msvc | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Validate tag ref | |
| shell: bash | |
| run: | | |
| if [[ "${GITHUB_REF}" != refs/tags/v* ]]; then | |
| echo "Release Updater must run on a version tag, current ref: ${GITHUB_REF}" | |
| exit 1 | |
| fi | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: "10" | |
| run_install: false | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| cache: "pnpm" | |
| cache-dependency-path: "pnpm-lock.yaml" | |
| - name: Install Rust stable | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: ${{ matrix.target }} | |
| - name: Install Linux dependencies | |
| if: matrix.os == 'ubuntu-22.04' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libgtk-3-dev libjavascriptcoregtk-4.1-dev libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Build Tauri bundles | |
| env: | |
| TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }} | |
| TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }} | |
| run: pnpm tauri build --target ${{ matrix.target }} | |
| - name: Stage release assets | |
| shell: bash | |
| run: | | |
| node .github/scripts/stage-release-assets.js \ | |
| "src-tauri/target/${{ matrix.target }}/release/bundle" \ | |
| "${{ matrix.target }}" \ | |
| "release-assets/${{ matrix.target }}" | |
| - name: Upload staged assets | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.target }} | |
| path: release-assets/${{ matrix.target }} | |
| if-no-files-found: error | |
| publish-release: | |
| runs-on: ubuntu-latest | |
| needs: build-assets | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Validate tag ref | |
| shell: bash | |
| run: | | |
| if [[ "${GITHUB_REF}" != refs/tags/v* ]]; then | |
| echo "Release Updater must run on a version tag, current ref: ${GITHUB_REF}" | |
| exit 1 | |
| fi | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| - name: Download staged assets | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: artifacts | |
| - name: Generate latest.json | |
| run: | | |
| node .github/scripts/build-latest-json.js \ | |
| "${{ github.ref_name }}" \ | |
| "${{ github.repository }}" \ | |
| "artifacts" \ | |
| "latest.json" | |
| - name: Ensure release exists | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| shell: bash | |
| run: | | |
| if ! gh release view "${GITHUB_REF_NAME}" >/dev/null 2>&1; then | |
| gh release create "${GITHUB_REF_NAME}" --title "Skills Manager ${GITHUB_REF_NAME}" --notes-file ".github/release-notes.md" | |
| fi | |
| - name: Upload release assets | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| shell: bash | |
| run: | | |
| mapfile -t files < <(find artifacts -type f | sort) | |
| gh release upload "${GITHUB_REF_NAME}" "${files[@]}" "latest.json" --clobber | |
| - name: Sync release notes | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| shell: bash | |
| run: | | |
| gh release edit "${GITHUB_REF_NAME}" \ | |
| --title "Skills Manager ${GITHUB_REF_NAME}" \ | |
| --notes-file ".github/release-notes.md" |