chore(release): 0.12.0 #17
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 | |
| on: | |
| push: | |
| tags: ["app-v*"] | |
| workflow_dispatch: | |
| inputs: | |
| tag: | |
| description: Release tag, for example app-v0.1.0 | |
| required: true | |
| type: string | |
| permissions: | |
| contents: write | |
| env: | |
| RELEASE_TAG: ${{ github.event_name == 'workflow_dispatch' && inputs.tag || github.ref_name }} | |
| jobs: | |
| build: | |
| name: Build ${{ matrix.label }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - { label: "macOS Intel", os: macos-latest, target: x86_64-apple-darwin, bundles: "app,dmg", suffix: macos-x64 } | |
| - { label: "macOS Apple Silicon", os: macos-latest, target: aarch64-apple-darwin, bundles: "app,dmg", suffix: macos-arm64 } | |
| - { label: "Windows x64", os: windows-latest, target: x86_64-pc-windows-msvc, bundles: "nsis", suffix: windows-x64 } | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: { ref: "${{ env.RELEASE_TAG }}", fetch-depth: 0 } | |
| - uses: pnpm/action-setup@v4 | |
| with: { version: 11.5.1 } | |
| - uses: actions/setup-node@v4 | |
| with: { node-version: 24.11.0, cache: pnpm } | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: { targets: "${{ matrix.target }}" } | |
| - uses: swatinem/rust-cache@v2 | |
| with: { workspaces: "src-tauri -> target" } | |
| - run: pnpm install --frozen-lockfile | |
| - run: pnpm test | |
| - run: pnpm typecheck | |
| - run: cargo test --manifest-path src-tauri/Cargo.toml | |
| - name: Validate tag | |
| shell: bash | |
| run: | | |
| version="$(node -p "require('./src-tauri/tauri.conf.json').version")" | |
| test "${RELEASE_TAG}" = "app-v${version}" | |
| - name: Generate release notes | |
| id: release_notes | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| version="${RELEASE_TAG#app-v}" | |
| node -e 'const notes=require("./changelog.json")[process.argv[1]]; if (!notes) process.exit(1); process.stdout.write(notes.en + "\n")' "${version}" > release-notes.md | |
| { | |
| echo "body<<EOF" | |
| cat release-notes.md | |
| echo "EOF" | |
| } >> "${GITHUB_OUTPUT}" | |
| - name: Build and publish | |
| uses: tauri-apps/tauri-action@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }} | |
| TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }} | |
| with: | |
| tagName: ${{ env.RELEASE_TAG }} | |
| releaseName: Taskmate ${{ env.RELEASE_TAG }} | |
| releaseBody: ${{ steps.release_notes.outputs.body }} | |
| releaseDraft: false | |
| prerelease: false | |
| args: --target ${{ matrix.target }} --bundles ${{ matrix.bundles }} --config src-tauri/tauri.release.conf.json | |
| - name: Normalize updater assets | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| mkdir -p normalized | |
| if [[ "${RUNNER_OS}" == "macOS" ]]; then | |
| search_dirs=() | |
| for dir in \ | |
| "src-tauri/target/${{ matrix.target }}/release/bundle/macos" \ | |
| "src-tauri/target/release/bundle/macos" | |
| do | |
| if [[ -d "${dir}" ]]; then | |
| search_dirs+=("${dir}") | |
| fi | |
| done | |
| if [[ "${#search_dirs[@]}" -eq 0 ]]; then | |
| echo "No Tauri macOS bundle directories were found." | |
| exit 1 | |
| fi | |
| archive="$(find "${search_dirs[@]}" -maxdepth 1 -type f -name '*.app.tar.gz' | head -n 1)" | |
| signature="$(find "${search_dirs[@]}" -maxdepth 1 -type f -name '*.app.tar.gz.sig' | head -n 1)" | |
| if [[ -z "${archive}" || -z "${signature}" ]]; then | |
| echo "The macOS updater archive or signature is missing." | |
| exit 1 | |
| fi | |
| cp "${archive}" "normalized/taskmate-${{ matrix.suffix }}.app.tar.gz" | |
| cp "${signature}" "normalized/taskmate-${{ matrix.suffix }}.app.tar.gz.sig" | |
| else | |
| search_dirs=() | |
| for dir in \ | |
| "src-tauri/target/${{ matrix.target }}/release/bundle/nsis" \ | |
| "src-tauri/target/release/bundle/nsis" | |
| do | |
| if [[ -d "${dir}" ]]; then | |
| search_dirs+=("${dir}") | |
| fi | |
| done | |
| if [[ "${#search_dirs[@]}" -eq 0 ]]; then | |
| echo "No Tauri NSIS bundle directories were found." | |
| exit 1 | |
| fi | |
| setup="$(find "${search_dirs[@]}" -maxdepth 1 -type f -name '*-setup.exe' | head -n 1)" | |
| if [[ -z "${setup}" ]]; then | |
| echo "The Windows setup executable is missing." | |
| exit 1 | |
| fi | |
| signature="${setup}.sig" | |
| if [[ ! -f "${signature}" ]]; then | |
| echo "The Windows setup executable signature is missing: ${signature}" | |
| exit 1 | |
| fi | |
| cp "${setup}" "normalized/taskmate-${{ matrix.suffix }}-setup.exe" | |
| cp "${signature}" "normalized/taskmate-${{ matrix.suffix }}-setup.exe.sig" | |
| fi | |
| - uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ env.RELEASE_TAG }} | |
| files: normalized/* | |
| updater-manifest: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Download signed updater assets | |
| env: { GH_TOKEN: "${{ secrets.GITHUB_TOKEN }}" } | |
| run: | | |
| mkdir assets | |
| gh release download "${RELEASE_TAG}" --repo "${GITHUB_REPOSITORY}" --dir assets --pattern 'taskmate-*.app.tar.gz*' --pattern 'taskmate-*-setup.exe*' | |
| - name: Build complete latest.json | |
| shell: bash | |
| env: { GH_TOKEN: "${{ secrets.GITHUB_TOKEN }}" } | |
| run: | | |
| version="${RELEASE_TAG#app-v}" | |
| base="${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/releases/download/${RELEASE_TAG}" | |
| notes="$(gh release view "${RELEASE_TAG}" --repo "${GITHUB_REPOSITORY}" --json body --jq .body)" | |
| jq -n \ | |
| --arg version "${version}" \ | |
| --arg date "$(date -u +'%Y-%m-%dT%H:%M:%SZ')" \ | |
| --arg notes "${notes}" \ | |
| --arg mx "$(cat assets/taskmate-macos-x64.app.tar.gz.sig)" \ | |
| --arg ma "$(cat assets/taskmate-macos-arm64.app.tar.gz.sig)" \ | |
| --arg wx "$(cat assets/taskmate-windows-x64-setup.exe.sig)" \ | |
| --arg base "${base}" \ | |
| '{version:$version,notes:$notes,pub_date:$date,platforms:{ | |
| "darwin-x86_64":{signature:$mx,url:($base+"/taskmate-macos-x64.app.tar.gz")}, | |
| "darwin-aarch64":{signature:$ma,url:($base+"/taskmate-macos-arm64.app.tar.gz")}, | |
| "windows-x86_64":{signature:$wx,url:($base+"/taskmate-windows-x64-setup.exe")} | |
| }}' > latest.json | |
| - uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ env.RELEASE_TAG }} | |
| files: latest.json |