Auto-create draft releases when building release tags (#2275)
Some checks failed
Spec / 🔎 Validate OpenAPI specifications (push) Has been cancelled
Spec / 🔎 Check Event schema examples (push) Has been cancelled
Spec / 🔎 Check OpenAPI definitions examples (push) Has been cancelled
Spec / 🔎 Check JSON Schemas inline examples (push) Has been cancelled
Spec / ⚙️ Calculate baseURL for later jobs (push) Has been cancelled
Spec / 📢 Run towncrier for changelog (push) Has been cancelled
Spell Check / Spell Check with Typos (push) Has been cancelled
Spec / 🐍 Build OpenAPI definitions (push) Has been cancelled
Spec / 📖 Build the spec (push) Has been cancelled
Spec / 🔎 Validate generated HTML (push) Has been cancelled
Spec / 📖 Build the historical backup spec (push) Has been cancelled
Spec / Create release (push) Has been cancelled

Update the CI so that it drafts a release, with the correct artifacts attached
and the release notes prepared, when building a release tag.
This commit is contained in:
Richard van der Hoff 2026-01-05 11:22:02 +00:00 committed by GitHub
parent 690c41e33b
commit 5a9f3c3bca
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 46 additions and 0 deletions

View file

@ -243,6 +243,14 @@ jobs:
name: "🔎 Validate generated HTML"
runs-on: ubuntu-latest
needs: [calculate-baseurl, build-spec]
# Run even if `generate-changelog` was skipped.
#
# `build-spec` has a dependency on `generate-changelog` to ensure order of execution
# and to access `needs.generate-changelog.result`. However, `generate-changelog` is
# skipped on tag builds; even a transient dependency on `generate-changelog` is then
# enough for this step to also be skipped by default on tag builds. Hence the need for
# this explicit `if`.
if: ${{ !failure() && !cancelled() }}
steps:
- name: "📥 Source checkout"
uses: actions/checkout@v4
@ -305,8 +313,45 @@ jobs:
- name: "📦 Tarball creation"
run: tar -czf spec-historical.tar.gz spec
- name: "📤 Artifact upload"
uses: actions/upload-artifact@v4
with:
name: spec-historical-artifact
path: spec-historical.tar.gz
# If we're building a tag, create a release and publish the artifacts
create_release:
name: "Create release"
if: ${{ !failure() && !cancelled() && startsWith(github.ref, 'refs/tags/') }}
needs:
- build-spec
- build-historical-spec
runs-on: ubuntu-latest
steps:
- name: "📥 Check out changelogs"
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
with:
sparse-checkout: |
content/changelog
- name: "📥 Download built spec"
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
with:
name: spec-artifact
- name: "📥 Download historical spec artifact"
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
with:
name: spec-historical-artifact
- name: "✨ Create draft release"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# Remove front-matter from changelog
sed '1,/^---$/d' "content/changelog/${{ github.ref_name }}.md" > changelog.md
# Create a draft release, using the changelog as release notes, and attaching the spec artifacts.
gh release create -d -t "${{ github.ref_name }}" \
-F "changelog.md" \
"${{ github.ref_name }}" \
spec.tar.gz \
spec-historical.tar.gz

View file

@ -0,0 +1 @@
Auto-create draft releases when building release tags.