diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 94d0c4d..b9db933 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,5 +1,7 @@ -# Builds Frame Studio for every computer it runs on, and the Frame Home installer, on each push. Each build is a -# downloadable artifact of the run; a tag "v*" also publishes them all as a GitHub release. +# Builds Frame Studio for every computer it runs on, and the Frame Home installer, on every push (any branch or tag), +# every pull request, and by hand (Actions > build > Run workflow). Each build is a downloadable artifact of the run. +# A push to main also replaces the "latest" pre-release with them (one place to download the newest of everything); +# a tag "v*" publishes them as that version's release. name: build on: @@ -7,6 +9,11 @@ on: pull_request: workflow_dispatch: +# A newer push to the same branch replaces a run still going (its builds would be out of date anyway). +concurrency: + group: build-${{ github.ref }} + cancel-in-progress: true + jobs: linux: name: Linux ${{ matrix.arch }} @@ -91,17 +98,28 @@ jobs: path: dist/FrameHome-installer.zip release: - if: startsWith(github.ref, 'refs/tags/v') + name: Publish + # (also when a platform failed: "latest" gets every build that worked; a version release needs them all) + if: ${{ !cancelled() && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main') }} needs: [linux, windows, macos, frame-home] runs-on: ubuntu-24.04 permissions: contents: write + env: + GH_TOKEN: ${{ github.token }} + REPO: ${{ github.repository }} steps: - uses: actions/download-artifact@v4 with: path: dist merge-multiple: true - - name: Publish - env: - GH_TOKEN: ${{ github.token }} - run: gh release create "${{ github.ref_name }}" dist/* --repo "${{ github.repository }}" --title "Frame Studio ${{ github.ref_name }}" --generate-notes + - name: Version release (tag v*) + if: ${{ startsWith(github.ref, 'refs/tags/v') && !contains(needs.*.result, 'failure') }} + run: gh release create "${{ github.ref_name }}" dist/* --repo "$REPO" --title "Frame Studio ${{ github.ref_name }}" --generate-notes + - name: Latest build (push to main) + if: github.ref == 'refs/heads/main' + run: | + gh release delete latest --repo "$REPO" --yes --cleanup-tag 2>/dev/null || true + gh release create latest dist/* --repo "$REPO" --prerelease --target "${{ github.sha }}" \ + --title "Latest build (${GITHUB_SHA::7})" \ + --notes "Built automatically from ${{ github.sha }} on $(date -u '+%Y-%m-%d %H:%M UTC'). Replaced by every push to main." diff --git a/README.md b/README.md index 9fb60b1..4a473c7 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,8 @@ area, add sounds and pictures, save environments and install them on the headset ## Downloads -Every push builds everything (Actions → the latest run → Artifacts); tagged versions are on the Releases page. +Every push builds everything (Actions → the run → Artifacts). The newest build of `main` is always on the Releases +page as **Latest build**; tagged versions (`git tag v1.0 && git push --tags`) get their own release. | Computer | Frame Studio | |---|---|