Viewing is open to everyone. Downloading and starring need a GitHub sign-in.
Sign in with GitHub
deprecate-release.yml
v0.1.0-build.85
Latest
Commit ede38f5
Sign in with GitHub to download. Each download is recorded with your GitHub username.
| 1 | # Marks a published release deprecated (spec §8.2; docs/BRANCHES-AND-RELEASES.md): |
| 2 | # retitles it "Deprecated - {release name}" and prepends a notice. The tag |
| 3 | # and its source stay available. Runnable only by users with write access. |
| 4 | name: Deprecate release |
| 5 | on: |
| 6 | workflow_dispatch: |
| 7 | inputs: |
| 8 | tag: |
| 9 | description: Release tag, e.g. v0.1.0-build.66 |
| 10 | required: true |
| 11 | replacement: |
| 12 | description: Tag that replaces it |
| 13 | required: true |
| 14 | reason: |
| 15 | description: Why it is deprecated |
| 16 | required: true |
| 17 | permissions: |
| 18 | contents: write |
| 19 | jobs: |
| 20 | deprecate: |
| 21 | runs-on: ubuntu-24.04 |
| 22 | steps: |
| 23 | - name: Retitle and annotate |
| 24 | env: |
| 25 | GH_TOKEN: ${{ github.token }} |
| 26 | TAG: ${{ inputs.tag }} |
| 27 | REPLACEMENT: ${{ inputs.replacement }} |
| 28 | REASON: ${{ inputs.reason }} |
| 29 | run: | |
| 30 | title="$(gh release view "$TAG" --repo "$GITHUB_REPOSITORY" --json name -q .name)" |
| 31 | case "$title" in "Deprecated - "*) echo "already deprecated"; exit 0;; esac |
| 32 | body="$(gh release view "$TAG" --repo "$GITHUB_REPOSITORY" --json body -q .body)" |
| 33 | printf '> **Deprecated:** use %s instead. %s\n\n%s\n' "$REPLACEMENT" "$REASON" "$body" > notes.md |
| 34 | gh release edit "$TAG" --repo "$GITHUB_REPOSITORY" --title "Deprecated - ${title}" --notes-file notes.md |
| 35 | - name: Reminder |
| 36 | run: echo "Also mark ${{ inputs.tag }} deprecated in CHANGELOG-STABLE.md, docs/support-matrix.json and the map's release table, and deprecate registry versions (npm deprecate, NuGet unlist, Maven note)." |