refactor: restructure release workflow jobs for clarity and efficiency
This commit is contained in:
@@ -8,7 +8,7 @@ permissions:
|
|||||||
contents: write
|
contents: write
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-and-upload:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
@@ -33,6 +33,26 @@ jobs:
|
|||||||
make release VERSION="$VERSION" PRERELEASE="$PRERELEASE"
|
make release VERSION="$VERSION" PRERELEASE="$PRERELEASE"
|
||||||
make release-cloud VERSION="$VERSION" PRERELEASE="$PRERELEASE"
|
make release-cloud VERSION="$VERSION" PRERELEASE="$PRERELEASE"
|
||||||
|
|
||||||
|
# Shared between the upload and tap-publish jobs so neither has to
|
||||||
|
# rebuild — lets a failed "Upload artifacts to release" run be
|
||||||
|
# retried on its own without re-running the whole build.
|
||||||
|
- name: Stash dist/ for downstream jobs
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: dist
|
||||||
|
path: dist/
|
||||||
|
retention-days: 1
|
||||||
|
|
||||||
|
upload-release:
|
||||||
|
needs: build
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Download dist/
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
name: dist
|
||||||
|
path: dist/
|
||||||
|
|
||||||
- name: Upload artifacts to release
|
- name: Upload artifacts to release
|
||||||
env:
|
env:
|
||||||
GITEA_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITEA_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
@@ -47,11 +67,30 @@ jobs:
|
|||||||
"${api}?name=${name}"
|
"${api}?name=${name}"
|
||||||
done
|
done
|
||||||
|
|
||||||
# Homebrew/Linuxbrew tap + Scoop bucket: only for stable releases —
|
# Homebrew/Linuxbrew tap + Scoop bucket: only for stable releases — a
|
||||||
# a prerelease shouldn't become what `brew install`/`scoop install`
|
# prerelease shouldn't become what `brew install`/`scoop install` resolve
|
||||||
# resolve to by default. See .gitea/scripts/publish-tap.sh.
|
# to by default. See .gitea/scripts/publish-tap.sh.
|
||||||
|
#
|
||||||
|
# Runs independently of upload-release's outcome (needs it only for
|
||||||
|
# ordering, not success) so a flaky asset upload doesn't block the tap
|
||||||
|
# from getting published. publish-tap.sh is idempotent — it no-ops if
|
||||||
|
# the tap is already at this version — so retrying upload-release later
|
||||||
|
# won't re-trigger a duplicate tap push.
|
||||||
|
publish-tap:
|
||||||
|
needs: [build, upload-release]
|
||||||
|
if: always() && needs.build.result == 'success' && gitea.event.release.prerelease != true
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Download dist/
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
name: dist
|
||||||
|
path: dist/
|
||||||
|
|
||||||
- name: Publish Homebrew/Scoop tap
|
- name: Publish Homebrew/Scoop tap
|
||||||
if: gitea.event.release.prerelease != true
|
|
||||||
env:
|
env:
|
||||||
VERSION: ${{ gitea.event.release.tag_name }}
|
VERSION: ${{ gitea.event.release.tag_name }}
|
||||||
TAP_TOKEN: ${{ secrets.TAP_TOKEN }}
|
TAP_TOKEN: ${{ secrets.TAP_TOKEN }}
|
||||||
|
|||||||
Reference in New Issue
Block a user