Skip to content

Commit 7520e24

Browse files
committed
ci: publish release candidates automatically on tag push
Revert the manual workflow_dispatch flow: pushing a v*-rc* tag now runs CI against the tag and publishes a GitHub pre-release, like the nightly flow. Publishing an RC supersedes the nightly line, so all nightly pre-releases are deleted at that point.
1 parent 1719a45 commit 7520e24

2 files changed

Lines changed: 26 additions & 33 deletions

File tree

.github/workflows/release.yml

Lines changed: 24 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -4,47 +4,23 @@ on:
44
push:
55
tags:
66
- 'v[0-9]*'
7-
- '!v[0-9]*-rc*'
8-
workflow_dispatch:
9-
inputs:
10-
tag:
11-
description: Release candidate tag to publish (e.g. v49.0-rc1)
12-
required: true
13-
type: string
147

158
permissions:
169
contents: write
1710
packages: write
1811

19-
env:
20-
RELEASE_TAG: ${{ inputs.tag || github.ref_name }}
21-
2212
jobs:
2313
ci:
24-
if: ${{ github.event_name == 'workflow_dispatch' || !contains(github.ref_name, '-') }}
14+
if: ${{ !contains(github.ref_name, '-') || contains(github.ref_name, '-rc') }}
2515
uses: ./.github/workflows/ci.yml
26-
with:
27-
checkout_ref: ${{ inputs.tag || '' }}
2816

2917
release:
3018
name: Create GitHub Release
31-
if: ${{ github.event_name == 'workflow_dispatch' || !contains(github.ref_name, '-') }}
19+
if: ${{ !contains(github.ref_name, '-') || contains(github.ref_name, '-rc') }}
3220
runs-on: ubuntu-latest
3321
needs: [ci]
3422
steps:
35-
- name: Validate release candidate tag
36-
if: ${{ github.event_name == 'workflow_dispatch' }}
37-
run: |
38-
set -euo pipefail
39-
tag="${{ inputs.tag }}"
40-
if [[ "$tag" != *-rc* ]]; then
41-
echo "Tag '$tag' is not a release candidate (expected to contain '-rc')." >&2
42-
exit 1
43-
fi
44-
4523
- uses: actions/checkout@v7
46-
with:
47-
ref: ${{ inputs.tag || '' }}
4824

4925
- name: Download extension zip
5026
uses: actions/download-artifact@v8
@@ -55,16 +31,33 @@ jobs:
5531
- name: Create GitHub Release
5632
uses: softprops/action-gh-release@v3
5733
with:
58-
tag_name: ${{ env.RELEASE_TAG }}
59-
name: ${{ env.RELEASE_TAG }}
34+
name: ${{ github.ref_name }}
6035
files: dist/target/aurora-shell@luminusos.github.io.shell-extension.zip
6136
generate_release_notes: true
62-
prerelease: ${{ github.event_name == 'workflow_dispatch' }}
37+
prerelease: ${{ contains(github.ref_name, '-') }}
38+
39+
# An RC supersedes the nightly line: once a release candidate is out,
40+
# the nightly pre-releases are removed like superseded nightlies are.
41+
- name: Delete superseded nightly pre-releases
42+
if: ${{ contains(github.ref_name, '-rc') }}
43+
env:
44+
GH_TOKEN: ${{ github.token }}
45+
run: |
46+
set -euo pipefail
47+
48+
gh release list \
49+
--limit 1000 \
50+
--json tagName,isPrerelease \
51+
--jq '.[] | select(.isPrerelease and (.tagName | test("-nightly[0-9]+$"))) | .tagName' |
52+
while IFS= read -r nightly_tag; do
53+
gh release delete "$nightly_tag" --cleanup-tag --yes
54+
echo "Deleted superseded nightly ${nightly_tag}." >> "$GITHUB_STEP_SUMMARY"
55+
done
6356
6457
- name: Create maintenance branch
65-
if: ${{ github.event_name == 'push' }}
58+
if: ${{ !contains(github.ref_name, '-') }}
6659
run: |
67-
MAJOR=$(echo "${{ env.RELEASE_TAG }}" | sed 's/^v//' | grep -oP '^\d+')
60+
MAJOR=$(echo "${{ github.ref_name }}" | sed 's/^v//' | grep -oP '^\d+')
6861
BRANCH="release/v${MAJOR}.x"
6962
if git ls-remote --exit-code --heads origin "$BRANCH" > /dev/null 2>&1; then
7063
echo "Branch $BRANCH already exists, skipping."

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ and adds a final version bump commit. For example, if `metadata.json` on `releas
103103

104104
Release candidates are published alongside GNOME Shell RCs. Tags follow the pattern `v50-rc1`, `v50-rc2`, etc. RC releases are marked as **pre-releases** on GitHub.
105105

106-
Pushing an RC tag does **not** publish anything. After pushing the tag, trigger the `Release` workflow manually (`workflow_dispatch`) and pass the tag name in the `tag` input. The workflow validates that the tag contains `-rc`, runs CI against it, and publishes the pre-release.
106+
Pushing an RC tag publishes it automatically: the `Release` workflow runs CI against the tag and creates the pre-release. An RC supersedes the nightly line, so publishing one deletes all nightly pre-releases.
107107

108108
### Stable releases
109109

@@ -189,7 +189,7 @@ D-Bus services.
189189

190190
All jobs must pass before a PR can be merged.
191191

192-
When a stable version tag (`v50.1`, `v50.2`, etc.) is pushed, `.github/workflows/release.yml` calls the CI pipeline and, if all jobs pass, publishes the GitHub Release automatically. Release candidate tags (`v50-rc1`, etc.) are excluded from this trigger and are published manually via `workflow_dispatch`, as described above.
192+
When a version tag (`v50.1`, `v50-rc1`, etc.) is pushed, `.github/workflows/release.yml` calls the CI pipeline and, if all jobs pass, publishes the GitHub Release automatically. Release candidate tags are published as pre-releases and supersede the nightly pre-releases, as described above.
193193

194194
## Coding Standards
195195

0 commit comments

Comments
 (0)