|
| 1 | +name: Release Tag |
| 2 | + |
| 3 | +# Tags a release when a `dev-v*` branch is merged to main, and pushes the tag. Delegates |
| 4 | +# to the reusable workflow in fleetbase/fleetbase. Requires org secret _GITHUB_AUTH_TOKEN |
| 5 | +# (inherited); no-ops with a warning until it is set. |
| 6 | +# |
| 7 | +# It pushes the tag and nothing else — create-release.yml and the publish jobs in this |
| 8 | +# repository already chain off `push: tags: v*`. |
| 9 | +# |
| 10 | +# The version is never retyped: it comes from the branch name, and the tag is refused |
| 11 | +# unless the files below and RELEASE.md already agree with it. This repository is |
| 12 | +# engine-only, so package.json is the single source of the version. |
| 13 | +# |
| 14 | +# RELEASE.md is required, and its first line must name the version being released. That |
| 15 | +# check is the only thing that can tell notes written for this release from the previous |
| 16 | +# release's notes nobody replaced. |
| 17 | +# |
| 18 | +# Deliberately unpinned, like postman.yml — it tracks the reusable workflow on main, so |
| 19 | +# there is no ref here to remember to bump. |
| 20 | +# |
| 21 | +# workflow_dispatch is the recovery path. Use it when a release failed validation and the |
| 22 | +# fix landed on main after the merge: re-running the merge event would check out the |
| 23 | +# merge commit and never see that fix. |
| 24 | + |
| 25 | +on: |
| 26 | + pull_request: |
| 27 | + types: [closed] |
| 28 | + branches: [main] |
| 29 | + workflow_dispatch: |
| 30 | + inputs: |
| 31 | + version: |
| 32 | + description: "Version to tag, e.g. 1.2.3. Recovery only — a normal release reads it from the branch." |
| 33 | + required: true |
| 34 | +permissions: |
| 35 | + contents: read |
| 36 | + |
| 37 | +jobs: |
| 38 | + tag: |
| 39 | + if: github.event_name == 'workflow_dispatch' || |
| 40 | + (github.event.pull_request.merged == true && |
| 41 | + startsWith(github.event.pull_request.head.ref, 'dev-v')) |
| 42 | + uses: fleetbase/fleetbase/.github/workflows/release-tag.yml@main |
| 43 | + with: |
| 44 | + version-files: package.json |
| 45 | + version: ${{ github.event.inputs.version || '' }} |
| 46 | + secrets: inherit |
0 commit comments