121 tweaks to release ci - #124
Merged
Merged
Conversation
Adds a new 'validate-version' job that runs as the first step in the release workflow. It compares the git tag version (e.g., v1.2.3) against the version declared in pyproject.toml and fails the entire workflow if they don't match. This prevents wasted CI time by catching human errors early (forgotten version bumps, typos in tags) before any platform-specific builds begin. Supports all version formats from 'uv version --bump' including: - Semantic versioning (1.0.0, 1.2.3) - Pre-release versions (1.0.0-rc.1, 1.0.0-alpha) - Build metadata (1.0.0+build.123) Provides clear error messages with recovery steps to help maintainers resolve version mismatches quickly. Closes: #121 (step 1 of 5)
Adds automatic generation and insertion of a security scan results table into the GitHub release notes after VirusTotal scanning completes. The table is placed after the auto-generated changelog and includes: - Binary filename - Platform (Linux x86_64/ARM64, Windows, macOS) - Status emoji (✅ PASS,⚠️ WARN, ❌ FAIL) - Detection counts (malicious, suspicious) - Clickable link to VirusTotal analysis page Implementation: - Collects scan results during the binary scanning loop - Platform is inferred from filename patterns - Table is only appended if scan passes (no malicious detections) - If scan fails or table update fails, release proceeds (table is optional) - Uses 'gh release edit' to prepend table to existing release notes The table provides maintainers and end users with immediate visibility into the security posture of each binary release. Closes: #121 (step 2 of 5)
Improves the comment explaining why 'contents: write' is necessary for the docs deployment job. The comment now explicitly notes that GitHub Actions does not offer branch-specific permissions, so the broad 'contents: write' permission is required even though the job only writes to the 'gh-pages' branch. This is a GitHub limitation, not a design choice, and is documented here for future maintainer clarity. Closes: #121 (step 3a of 5)
Improves the comment explaining why the VirusTotal scanning job requires 'contents: write' permission. The comment now explicitly notes that draft releases are only accessible to repository collaborators and require this permission level (cannot use 'contents: read'). This clarifies that the permission is necessary, not over-scoped, and prevents future maintainers from attempting to reduce it to 'contents: read'. References commit 9106eb1 which discovered this GitHub limitation empirically. Closes: #121 (step 3b of 5)
Adds checksum verification to the Windows resvg binary download to detect potential tampering or corruption. The SHA256 hash is verified before extraction and the build fails if it doesn't match. resvg v0.44.0 SHA256: 4fd4ac0640bc0ee4b4e20335d9b7636d5e5b9722cfeaee4cd51b86655dcfdae5 This improves supply-chain security by catching binary modifications at build time rather than silently using a potentially compromised artifact. Closes: #121 (step 3c of 5)
Closed
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the GitHub Actions release/docs workflows to fail fast on version/tag mismatches, improve release-note UX with VirusTotal scan results, clarify permissions rationale, and harden the Windows resvg download with checksum verification.
Changes:
- Added a new “validate-version” job intended to ensure the pushed tag version matches
pyproject.tomlbefore running expensive builds. - Enhanced the VirusTotal scanning job to collect per-binary results and update the GitHub Release notes with a Markdown results table.
- Added SHA256 verification for the Windows
resvg-win64.zipdownload and clarified workflow permission comments.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| .github/workflows/release.yml | Adds tag↔pyproject validation, hardens Windows resvg download, and writes VirusTotal scan results into release notes. |
| .github/workflows/docs.yml | Clarifies why contents: write is required (no branch-scoped permissions). |
Comments suppressed due to low confidence (2)
.github/workflows/release.yml:424
- YAML indentation is off here: the
Install resvgstep is indented deeper than the other entries insteps, so it will be parsed as part of the previouswith:block and make the workflow invalid.
- name: Install resvg (headless SVG→PNG, no display required)
shell: pwsh
run: |
.github/workflows/release.yml:972
- YAML indentation is invalid:
permissions:is indented one extra space compared to the other job keys (runs-on,needs,if). This will break workflow parsing.
needs: [build-linux, build-linux-arm64, build-windows, build-macos]
if: success() # Only run if all builds succeeded
permissions:
contents: write # Required to download assets from draft releases
# (Draft releases are collaborator-only; cannot use contents:read)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
The validate-version job was not blocking the expensive build jobs because they didn't declare a dependency on it. This allowed all four build jobs (build-linux, build-linux-arm64, build-windows, build-macos) to start in parallel immediately, preventing fail-fast on version mismatch. Added 'needs: validate-version' to all four build jobs to ensure version validation completes before any builds begin. This achieves the intended behavior: version mismatches are caught in seconds rather than after 30-75 minutes of CI execution. Fixes issue raised in PR #124 code review.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Jason Farrar <farrar.jason1@gmail.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Jason Farrar <farrar.jason1@gmail.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Jason Farrar <farrar.jason1@gmail.com>
…an into 121-tweaks-to-release-ci
- Fix build-linux job indentation (2 spaces for name, 4 for attributes, 6 for steps) - Fix build-linux-arm64 job indentation (same pattern) - Fix build-windows job indentation (same pattern, including resvg step) - Fix build-macos job indentation (same pattern) - Fix scan-with-virustotal job attributes (if, permissions: 4 spaces) All jobs now follow consistent GitHub Actions indentation: 2-space for job names, 4-space for job attributes, 6-space for step items, 8-space for step properties. Addresses code review feedback on indentation errors.
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (1)
.github/workflows/release.yml:112
- Same quoting issue as above: the suggested
git tag -m 'Release $PYPROJECT_VERSION'uses single quotes, so$PYPROJECT_VERSIONwill not expand if copy/pasted.
echo " git tag -d v$TAG_VERSION"
echo " git push origin :refs/tags/v$TAG_VERSION"
echo " 2. Re-tag: git tag -a v$PYPROJECT_VERSION -m 'Release $PYPROJECT_VERSION'"
echo " 3. Push: git push origin main v$PYPROJECT_VERSION"
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Jason Farrar <farrar.jason1@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
✅ ACTION POINT 1: Version Validation Job
Commit:
aa4dda4uv version --bumpformats (1.0.0-rc.1,1.0.0+build.1, etc.)Key: Catches human errors early—forgotten version bumps, typos in tags—before expensive builds begin.
✅ ACTION POINT 2: VirusTotal Results Table in Release Notes
Commit: 9af19a8
Example table:
Binary Platform
openstan-1.2.3-Windows.msi Windows
Key: Provides immediate security visibility for both maintainers and end users.
✅ ACTION POINT 3a: Clarified docs.yml Permission Comment
Commit: e695b40
✅ ACTION POINT 3b: Clarified scan-with-virustotal Permission Comment
Commit: 3c8f60b
Key: The permission level is appropriate and necessary by design.
✅ ACTION POINT 3c: Added Checksum Verification to resvg Download
Commit: b010965