From 57abbf9e2efbfccaae7a224d8bfb4b33bf1541ea Mon Sep 17 00:00:00 2001 From: Cato <41178744+catomean@users.noreply.github.com> Date: Sun, 25 Oct 2026 09:30:48 +0100 Subject: [PATCH] chore: add the fleet package template files this repo is missing (git-release.yml) (#5) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Files from bitbaum/fleet `templates/package` that this repository does not have yet: - `.github/workflows/git-release.yml` Only missing files are added — no file this repository already has is changed. `release.yml` is what lets the package owner release a new version from Loki (the package page: "Release vX.Y.Z"), or from the Actions tab. Opened by bitbaum/fleet `scripts/packages/sync-package-template.mjs` (`.github/workflows/package-repos.yml`). It merges itself when this repository's CI is green. Co-authored-by: bitbaum-fleet --- .github/workflows/git-release.yml | 45 +++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .github/workflows/git-release.yml diff --git a/.github/workflows/git-release.yml b/.github/workflows/git-release.yml new file mode 100644 index 0000000..0980332 --- /dev/null +++ b/.github/workflows/git-release.yml @@ -0,0 +1,45 @@ +name: Verified Git release +on: + workflow_run: + workflows: [CI] + types: [completed] + branches: [main] +permissions: + contents: write +concurrency: + group: verified-git-release + cancel-in-progress: false +jobs: + release: + if: >- + github.event.workflow_run.conclusion == 'success' && + github.event.workflow_run.head_repository.full_name == github.repository && + github.event.workflow_run.head_branch == 'main' && + github.event.workflow_run.event != 'pull_request' + runs-on: ubuntu-latest + timeout-minutes: 5 + steps: + - uses: actions/checkout@v7 + with: + ref: ${{ github.event.workflow_run.head_sha }} + fetch-depth: 0 + - name: Tag the verified immutable artifact, even before npm bootstrap + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + VERIFIED_SHA: ${{ github.event.workflow_run.head_sha }} + run: | + set -euo pipefail + version=$(node -p "require('./package.json').version") + if ! [[ "$version" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + echo "Only stable package versions get a Git release" >&2 + exit 1 + fi + tag="v$version" + if git show-ref --verify --quiet "refs/tags/$tag"; then + echo "$tag already exists; immutable tags are never moved." + exit 0 + fi + git tag "$tag" "$VERIFIED_SHA" + git push origin "refs/tags/$tag" + gh release create "$tag" --repo "$GITHUB_REPOSITORY" \ + --verify-tag --title "$tag" --generate-notes