-
Notifications
You must be signed in to change notification settings - Fork 0
ci(release): create GitHub Release after successful PyPI publish (VER-001) #48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -134,3 +134,62 @@ jobs: | |||||||||||||||||||||||||||||||||||||||||||||||
| assert wave_sdk.__version__ == '$TAG_VERSION', wave_sdk.__version__ | ||||||||||||||||||||||||||||||||||||||||||||||||
| print('verified wave-sdk', wave_sdk.__version__, 'installed from PyPI, Wave facade OK') | ||||||||||||||||||||||||||||||||||||||||||||||||
| " | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| # --------------------------------------------------------------------------------------- | ||||||||||||||||||||||||||||||||||||||||||||||||
| # VER-001. Create the GitHub Release for the tag once the artifact is confirmed live on | ||||||||||||||||||||||||||||||||||||||||||||||||
| # PyPI — this job needs `publish` (which itself only runs `if: startsWith(github.ref, | ||||||||||||||||||||||||||||||||||||||||||||||||
| # 'refs/tags/v')`, i.e. never on a PR dry-run) to have SUCCEEDED, which for `publish` | ||||||||||||||||||||||||||||||||||||||||||||||||
| # includes its own "Post-publish verification" step above, so a Release is never created | ||||||||||||||||||||||||||||||||||||||||||||||||
| # for a wheel that reached `twine upload`/Trusted Publishing but was never actually | ||||||||||||||||||||||||||||||||||||||||||||||||
| # confirmed live. Idempotent: a Release that already exists for this tag gets its | ||||||||||||||||||||||||||||||||||||||||||||||||
| # dist/ artifacts re-uploaded with --clobber instead of failing on "already exists". | ||||||||||||||||||||||||||||||||||||||||||||||||
| # --------------------------------------------------------------------------------------- | ||||||||||||||||||||||||||||||||||||||||||||||||
| release: | ||||||||||||||||||||||||||||||||||||||||||||||||
| name: Create GitHub Release | ||||||||||||||||||||||||||||||||||||||||||||||||
| needs: publish | ||||||||||||||||||||||||||||||||||||||||||||||||
| if: needs.publish.result == 'success' | ||||||||||||||||||||||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||||||||||||||||||||||||||||||
| timeout-minutes: 10 | ||||||||||||||||||||||||||||||||||||||||||||||||
| permissions: | ||||||||||||||||||||||||||||||||||||||||||||||||
| contents: write # create/upload the Release for this tag — nothing else | ||||||||||||||||||||||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||||||||||||||||||||||
| - uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||||||||||
| name: dist | ||||||||||||||||||||||||||||||||||||||||||||||||
| path: dist | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+156
to
+159
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Suggestion: The release downloads artifacts from the earlier build, while PyPI receives a separate rebuild, so non-reproducible metadata can make release assets differ from published artifacts. [api mismatch] Assessment: 🟠 Prompt for AI Agent 🤖This is a comment left during a code review.
**Path:** .github/workflows/release.yml
**Line:** 156:159
**Comment:**
*Api Mismatch: The release downloads artifacts from the earlier build, while PyPI receives a separate rebuild, so non-reproducible metadata can make release assets differ from published artifacts.
Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix |
||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| # TAG_NAME comes from the environment (never interpolated into the script body), | ||||||||||||||||||||||||||||||||||||||||||||||||
| # matching the "Verify tag matches package version" step above. | ||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Create or update the GitHub Release (idempotent) | ||||||||||||||||||||||||||||||||||||||||||||||||
| env: | ||||||||||||||||||||||||||||||||||||||||||||||||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||||||||||||||||||||||||||||||||||||||||||||||||
| TAG_NAME: ${{ github.ref_name }} | ||||||||||||||||||||||||||||||||||||||||||||||||
| GH_REPO: ${{ github.repository }} | ||||||||||||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||||||||||||
| set -euo pipefail | ||||||||||||||||||||||||||||||||||||||||||||||||
| shopt -s nullglob | ||||||||||||||||||||||||||||||||||||||||||||||||
| ASSETS_TO_UPLOAD=(dist/*) | ||||||||||||||||||||||||||||||||||||||||||||||||
| if [ "${#ASSETS_TO_UPLOAD[@]}" -eq 0 ]; then | ||||||||||||||||||||||||||||||||||||||||||||||||
| echo "::error::no files under dist/ to attach to the release" | ||||||||||||||||||||||||||||||||||||||||||||||||
| exit 1 | ||||||||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||||||||
| if gh release view "$TAG_NAME" >/dev/null 2>&1; then | ||||||||||||||||||||||||||||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Suggestion: Any Assessment: 🟠 Prompt for AI Agent 🤖This is a comment left during a code review.
**Path:** .github/workflows/release.yml
**Line:** 176:176
**Comment:**
*Logic Error: Any `gh release view` failure is treated as absence, so authentication, repository, or transient API errors trigger misleading creation attempts and hide the original failure.
Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix |
||||||||||||||||||||||||||||||||||||||||||||||||
| echo "release $TAG_NAME already exists — uploading dist/ (idempotent path, --clobber)" | ||||||||||||||||||||||||||||||||||||||||||||||||
| gh release upload "$TAG_NAME" "${ASSETS_TO_UPLOAD[@]}" --clobber | ||||||||||||||||||||||||||||||||||||||||||||||||
| else | ||||||||||||||||||||||||||||||||||||||||||||||||
| echo "release $TAG_NAME does not exist — creating with generated notes" | ||||||||||||||||||||||||||||||||||||||||||||||||
| gh release create "$TAG_NAME" "${ASSETS_TO_UPLOAD[@]}" --title "$TAG_NAME" --generate-notes | ||||||||||||||||||||||||||||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P2: If the tag is deleted before this command runs, Prompt for AI agents
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+176
to
+182
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P1: Distinguish a not-found response from other Prompt for AI agents
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||
| echo "verifying the release exists and carries every dist/ asset" | ||||||||||||||||||||||||||||||||||||||||||||||||
| ASSETS="$(gh release view "$TAG_NAME" --json assets --jq '[.assets[].name] | join(" ")')" | ||||||||||||||||||||||||||||||||||||||||||||||||
| echo "release assets: $ASSETS" | ||||||||||||||||||||||||||||||||||||||||||||||||
| for f in "${ASSETS_TO_UPLOAD[@]}"; do | ||||||||||||||||||||||||||||||||||||||||||||||||
| case "$ASSETS" in | ||||||||||||||||||||||||||||||||||||||||||||||||
| *"$(basename "$f")"*) ;; | ||||||||||||||||||||||||||||||||||||||||||||||||
| *) | ||||||||||||||||||||||||||||||||||||||||||||||||
| echo "::error::$(basename "$f") missing from release $TAG_NAME after upload" | ||||||||||||||||||||||||||||||||||||||||||||||||
| exit 1 | ||||||||||||||||||||||||||||||||||||||||||||||||
| ;; | ||||||||||||||||||||||||||||||||||||||||||||||||
| esac | ||||||||||||||||||||||||||||||||||||||||||||||||
| done | ||||||||||||||||||||||||||||||||||||||||||||||||
| echo "VER-001: GitHub Release for $TAG_NAME exists and carries the built dist/ artifacts." | ||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P1: Publish the exact
dist/artifact used here, or make the release consume the artifact produced by the PyPI publish job. A separate rebuild can produce different metadata or bytes, leaving the GitHub Release out of sync with the package verified on PyPI.Prompt for AI agents