Skip to content

Commit d54869a

Browse files
committed
ci(release): add -beta prerelease handling, gate promotion PR
1 parent 0d339d3 commit d54869a

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

.github/workflows/release.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,13 @@ jobs:
4949
# branch (not main) and uses gh to open + auto-merge the PR.
5050
token: ${{ secrets.GITHUB_TOKEN }}
5151

52+
- name: Detect beta tag
53+
id: beta
54+
shell: pwsh
55+
run: |
56+
$isBeta = '${{ github.ref_name }}' -like '*-beta*'
57+
"is_beta=$($isBeta.ToString().ToLower())" >> $env:GITHUB_OUTPUT
58+
5259
- name: Fetch release tags
5360
shell: pwsh
5461
run: |
@@ -152,7 +159,9 @@ jobs:
152159
$notes | Out-File -LiteralPath $notesPath -Encoding utf8 -NoNewline
153160
"input_path=$notesPath" >> $env:GITHUB_OUTPUT
154161
# gh release create accepts the asset paths as positional arguments after the tag.
155-
gh release create $tag $zip --title $tag --notes-file $notesPath
162+
$extra = @()
163+
if ('${{ steps.beta.outputs.is_beta }}' -eq 'true') { $extra = @('--prerelease','--latest=false') }
164+
gh release create $tag $zip --title $tag --notes-file $notesPath @extra
156165
157166
- name: Verify published release body matches input
158167
env:
@@ -368,6 +377,7 @@ jobs:
368377
echo "Hash append commit: $new_oid (verified)"
369378
370379
- name: Open promotion PR + enable auto-merge
380+
if: ${{ steps.beta.outputs.is_beta != 'true' }}
371381
# We can't push directly to main: branch protection requires the
372382
# "dotnet build + test" status check, which a bot push bypasses (so
373383
# the push is rejected). Instead we open a PR off the tag and let

0 commit comments

Comments
 (0)