Skip to content

121 tweaks to release ci - #124

Merged
boscorat merged 12 commits into
masterfrom
121-tweaks-to-release-ci
Jul 23, 2026
Merged

121 tweaks to release ci#124
boscorat merged 12 commits into
masterfrom
121-tweaks-to-release-ci

Conversation

@boscorat

Copy link
Copy Markdown
Owner

✅ ACTION POINT 1: Version Validation Job
Commit: aa4dda4

  • Blocking: Entire workflow fails if versions don't match
  • Pre-releases: Full support for all uv version --bump formats (1.0.0-rc.1, 1.0.0+build.1, etc.)
  • Placement: Runs as first job before any builds (saves 30–75 min of CI time)
  • UX: Clear error messages with recovery instructions
    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

  • ✅ Placement: After changelog (as requested)
  • ✅ Content: Filename, Platform, Status emoji, Detection counts, VirusTotal links
  • ✅ No Actions log display: Results only appear in release notes (clean logs)
  • ✅ Error handling: If scan fails or table update fails, release still proceeds (table is optional, not blocking)
    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

  • Explains that GitHub Actions doesn't offer branch-specific permissions
  • Clarifies this is a GitHub API limitation, not a design choice
  • Prevents future maintainers from trying to reduce permissions incorrectly

✅ ACTION POINT 3b: Clarified scan-with-virustotal Permission Comment
Commit: 3c8f60b

  • Critical finding: Your instinct was CORRECT—contents: read doesn't work for draft releases
  • Explains that draft releases are collaborator-only and require contents: write
  • Prevents future maintainers from attempting to reduce this permission (it won't work)
  • References the commit where this was discovered empirically (9106eb1)
    Key: The permission level is appropriate and necessary by design.

✅ ACTION POINT 3c: Added Checksum Verification to resvg Download
Commit: b010965

  • ✅ Verifies SHA256 of resvg-win64.zip before extraction
  • ✅ Build fails if checksum mismatches
  • ✅ Catches binary tampering or corruption at build time

boscorat added 5 commits July 23, 2026 10:09
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)
@boscorat boscorat linked an issue Jul 23, 2026 that may be closed by this pull request
@boscorat
boscorat requested a review from Copilot July 23, 2026 10:10

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.toml before 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.zip download 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 resvg step is indented deeper than the other entries in steps, so it will be parsed as part of the previous with: 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.

Comment thread .github/workflows/release.yml
Comment thread .github/workflows/release.yml Outdated
Comment thread .github/workflows/release.yml Outdated
Comment thread .github/workflows/release.yml Outdated
boscorat and others added 6 commits July 23, 2026 11:28
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>
- 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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_VERSION will 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"

Comment thread .github/workflows/release.yml Outdated
Comment thread .github/workflows/release.yml
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Jason Farrar <farrar.jason1@gmail.com>
@boscorat
boscorat merged commit 475c4a2 into master Jul 23, 2026
2 checks passed
@boscorat
boscorat deleted the 121-tweaks-to-release-ci branch July 23, 2026 11:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tweaks to release CI

2 participants