Skip to content

Commit e25061d

Browse files
committed
chore(ci): CHANGELOG preflight, robust wheel glob, annotated Go SDK tag
- changelog_preflight job: blocks the release if pulumi/CHANGELOG.md has no entry mentioning the pushed tag. Prevents silent unannotated releases when a tag is pushed without a docs update. - Wheel upload: replace 'ls | head -n1' with a nullglob bash array assertion that fails loudly on zero or multiple wheels (the old code would silently pick the first of many on a dirty workspace). - Go SDK tag: annotated (-a with -m) instead of lightweight so the tag carries a meaningful git object message.
1 parent 435dc35 commit e25061d

1 file changed

Lines changed: 33 additions & 6 deletions

File tree

.github/workflows/pulumi-release.yml

Lines changed: 33 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,28 @@ jobs:
3131
name: Prerequisites
3232
uses: ./.github/workflows/pulumi-prerequisites.yml
3333

34+
changelog_preflight:
35+
name: CHANGELOG Preflight
36+
needs: prerequisites
37+
runs-on: ubuntu-latest
38+
timeout-minutes: 15
39+
steps:
40+
- name: Checkout
41+
uses: actions/checkout@v4
42+
43+
- name: Ensure CHANGELOG entry exists for tag
44+
# Fails the release if pulumi/CHANGELOG.md has no header/line
45+
# mentioning the tag — forces an explicit changelog update before
46+
# every tag push.
47+
run: |
48+
if ! grep -q "${GITHUB_REF_NAME}" pulumi/CHANGELOG.md; then
49+
echo "::error::No CHANGELOG entry for ${GITHUB_REF_NAME} in pulumi/CHANGELOG.md"
50+
exit 1
51+
fi
52+
3453
release_provider:
3554
name: Release Provider
36-
needs: prerequisites
55+
needs: [prerequisites, changelog_preflight]
3756
runs-on: ubuntu-latest
3857
timeout-minutes: 30
3958
steps:
@@ -141,13 +160,21 @@ jobs:
141160
- name: Upload wheel to release
142161
env:
143162
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
163+
# Asserts exactly one wheel is present — `ls | head -n1` would
164+
# silently pick the first of many on a dirty workspace.
144165
run: |
145-
WHEEL_FILE=$(ls pulumi/sdk/python/dist/pulumi_flashblade-*.whl | head -n1)
146-
if [ -z "$WHEEL_FILE" ]; then
147-
echo "Wheel file not found"
166+
shopt -s nullglob
167+
wheels=(pulumi/sdk/python/dist/pulumi_flashblade-*.whl)
168+
if [ ${#wheels[@]} -eq 0 ]; then
169+
echo "::error::No wheel matched pulumi/sdk/python/dist/pulumi_flashblade-*.whl"
170+
exit 1
171+
fi
172+
if [ ${#wheels[@]} -gt 1 ]; then
173+
echo "::error::Multiple wheels found — expected exactly 1:"
174+
printf ' %s\n' "${wheels[@]}"
148175
exit 1
149176
fi
150-
gh release upload "${GITHUB_REF_NAME}" "$WHEEL_FILE" --clobber
177+
gh release upload "${GITHUB_REF_NAME}" "${wheels[0]}" --clobber
151178
152179
tag_go_sdk:
153180
name: Tag Go SDK
@@ -189,5 +216,5 @@ jobs:
189216
echo "Tag ${GO_TAG} already exists on remote — skipping (idempotent rerun)"
190217
exit 0
191218
fi
192-
git tag "${GO_TAG}" "${GITHUB_SHA}"
219+
git tag -a "${GO_TAG}" "${GITHUB_SHA}" -m "Pulumi Go SDK ${GO_TAG#sdk/go/}"
193220
git push origin "${GO_TAG}"

0 commit comments

Comments
 (0)