summarum/.github/workflows/release.yml
Horizontal42 cfe5336aa3 serialize release matrix builds to fix duplicate-release race
Running x64/arm64 tauri-action in parallel let both jobs race on
find-or-create-release for the same tag, producing two release objects
that each only got their own arch's assets (and a latest.json missing
the other platform's entry, breaking auto-update for it).
2026-07-01 16:28:52 +03:00

79 lines
2.3 KiB
YAML

name: Release
on:
push:
tags:
- "v*.*.*"
permissions:
contents: write
jobs:
build:
strategy:
fail-fast: false
# tauri-action's find-or-create-release check races across parallel
# matrix jobs and can create two separate release objects for the
# same tag, each missing the other's assets — force serial builds
max-parallel: 1
matrix:
include:
- target: x86_64-pc-windows-msvc
arch: x64
- target: aarch64-pc-windows-msvc
arch: arm64
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
- uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- uses: Swatinem/rust-cache@v2
with:
workspaces: src-tauri
key: ${{ matrix.target }}
- run: npm ci
- uses: tauri-apps/tauri-action@v0
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: ${{ github.ref_name }}
releaseName: "Summarum ${{ github.ref_name }}"
releaseDraft: true
prerelease: false
args: --target ${{ matrix.target }}
notes:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
prev=$(git tag --sort=-v:refname | grep -v "^${{ github.ref_name }}$" | head -1)
{
echo "## What's new"
if [ -n "$prev" ]; then
git log "$prev..${{ github.ref_name }}" --pretty=format:"- %s" --no-merges | grep -v "^- bump version"
echo ""
echo "**Full Changelog**: https://github.com/${{ github.repository }}/compare/$prev...${{ github.ref_name }}"
else
git log "${{ github.ref_name }}" --pretty=format:"- %s" --no-merges | grep -v "^- bump version"
fi
} > notes.md
gh release edit "${{ github.ref_name }}" --notes-file notes.md