Files
bitbaum-fleet b167b55c1c @bitbaum/writingkit 0.1.0: its own repo
Moved from bitbaum/orangecat packages/writingkit at 0e410b309710e7c558ada4c5903b3b5bb10e24a4; the history before this commit is there. Created by bitbaum/fleet scripts/packages/create-package-repos.mjs from registers/package-repos.json.
2026-11-05 09:54:55 +00:00

47 lines
1.5 KiB
YAML

# prettier-ignore
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