Skip to content

Adds release helper scripts#37

Merged
nefarius merged 3 commits intomasterfrom
release-job
Feb 28, 2026
Merged

Adds release helper scripts#37
nefarius merged 3 commits intomasterfrom
release-job

Conversation

@nefarius
Copy link
Owner

@nefarius nefarius commented Feb 28, 2026

Summary by CodeRabbit

  • Chores
    • Added an automated release workflow that builds platform-specific binaries (Win32, x64, ARM64) when a version tag is pushed.
    • Added documentation describing the tagged release workflow and finalization steps.
    • Added a local release finalization tool to perform signing and publish the final release artifact.

@nefarius nefarius self-assigned this Feb 28, 2026
@coderabbitai
Copy link

coderabbitai bot commented Feb 28, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0d8cfb7 and f5b945c.

📒 Files selected for processing (1)
  • .github/workflows/release.yml
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/release.yml

📝 Walkthrough

Walkthrough

Adds a tag-triggered GitHub Actions release workflow that builds Injector.exe for Win32, x64, and ARM64 and produces an unsigned bundle and draft release, plus a PowerShell script and documentation to download, EV-sign, repackage, and publish the final signed release locally.

Changes

Cohort / File(s) Summary
Release workflow
.github/workflows/release.yml
New GitHub Actions workflow triggered on version tag pushes; builds Injector.sln across platforms (Win32, x64, ARM64) in a matrix, stages per-platform Injector.exe artifacts, and produces an unsigned combined bundle and draft release.
Local finalize tooling
scripts/finalize-release.ps1
New PowerShell script to locate/download the unsigned artifact, validate and sign ARM64/Win32/x64 binaries using signtool (via wdkwhere), repackage signed ZIP, upload to the tag release, and optionally publish. Includes helper functions Ensure-WdkWhere, Resolve-UnsignedZip, Sign-Binary.
Documentation
RELEASE.md
New release documentation describing tag triggers, workflow outputs (unsigned bundle), prerequisites (gh CLI, wdkwhere, EV cert), and usage of finalize-release.ps1 to sign and publish the final release.

Sequence Diagram

sequenceDiagram
    participant Dev as Developer
    participant Git as Git/GitHub
    participant GHA as GitHub Actions
    participant Build as MSBuild
    participant API as GitHub API
    participant Local as Local Machine
    participant SignTool as SignTool

    Dev->>Git: Push tag (e.g., v1.5.0)
    Git->>GHA: Trigger release workflow

    rect rgba(100,150,200,0.5)
    Note over GHA,Build: Build Stage (matrix: Win32, x64, ARM64)
    GHA->>GHA: Checkout code
    GHA->>GHA: Setup MSBuild
    loop per platform
        GHA->>Build: Build Injector.sln (Release, platform)
        Build-->>GHA: Injector.exe
        GHA->>GHA: Verify & upload platform artifact
    end
    end

    rect rgba(150,100,200,0.5)
    Note over GHA,API: Package & Release Stage
    GHA->>GHA: Download platform artifacts
    GHA->>GHA: Assemble release dirs and copy binaries
    GHA->>GHA: Create unsigned ZIP bundle
    GHA->>GHA: Upload unsigned bundle artifact
    GHA->>API: Create draft GitHub release
    API-->>GHA: Draft release created
    end

    rect rgba(200,150,100,0.5)
    Note over Dev,SignTool: Local Finalization (manual on EV machine)
    Dev->>Local: Run finalize-release.ps1 -Tag -CertificateSubjectName
    Local->>API: Query workflow runs / download unsigned artifact
    API-->>Local: Return unsigned bundle
    Local->>Local: Extract binaries
    loop per platform binary
        Local->>SignTool: Sign binary (signtool via wdkwhere)
        SignTool-->>Local: Signed binary
    end
    Local->>Local: Repackage signed ZIP
    Local->>API: Upload signed ZIP to release and optionally publish
    API-->>Dev: Release published
    end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Poem

🐰 I hopped through tags and CI at dawn,

Built three binaries and bundled them on.
A local sig, a final zip tight—
Draft to published, out into flight.
Hooray for releases, signed just right!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main addition: a GitHub Actions release workflow, finalization script, and release documentation enabling automated release processes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch release-job

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (2)
scripts/finalize-release.ps1 (2)

66-66: Consider checking $LASTEXITCODE after gh CLI commands.

The script checks $LASTEXITCODE after signtool (line 89) but not after gh commands. If gh run download fails with a non-zero exit code without writing to stderr, $ErrorActionPreference = "Stop" may not catch it.

Example pattern
     gh run download $run.databaseId -n $artifactName -D $downloadDir | Out-Null
+    if ($LASTEXITCODE -ne 0) {
+        throw "gh run download failed with exit code $LASTEXITCODE."
+    }

Consider applying this pattern to other gh calls (lines 97, 133, 134, 138) for robust error handling.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@scripts/finalize-release.ps1` at line 66, Add explicit exit-code checks after
every gh CLI invocation (for example the gh run download call and other gh calls
around the variables artifactName/downloadDir and the subsequent gh commands)
similar to how signtool is validated: after each gh ... call, test $LASTEXITCODE
and, if non-zero, write an error message to the console (including the command
and exit code) and exit with that code; ensure you apply the same pattern to the
other gh calls referenced in the review to make failure handling deterministic.

9-9: Consider using HTTPS for the timestamp URL.

The default timestamp URL uses http:// which transmits data unencrypted. DigiCert supports HTTPS for their timestamp service.

Proposed fix
-    [string]$TimestampUrl = "http://timestamp.digicert.com",
+    [string]$TimestampUrl = "https://timestamp.digicert.com",
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@scripts/finalize-release.ps1` at line 9, Update the timestamp URL string to
use HTTPS instead of HTTP by changing the $TimestampUrl variable assignment
(look for the [string]$TimestampUrl declaration) so the timestamping uses
"https://timestamp.digicert.com"; ensure any code that consumes $TimestampUrl
continues to work with the new scheme (no additional behavioral changes
required).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/release.yml:
- Around line 36-39: The script uses Write-Error with Test-Path to check
$source, which produces a non-terminating error and allows execution to continue
(leading to a confusing Copy-Item failure); change the error handling so the
check for Test-Path triggers a terminating error (for example replace the
Write-Error call with throw or use -ErrorAction Stop) when $source is missing,
ensuring the workflow halts immediately and surfaces a clear failure message
referencing $source.

---

Nitpick comments:
In `@scripts/finalize-release.ps1`:
- Line 66: Add explicit exit-code checks after every gh CLI invocation (for
example the gh run download call and other gh calls around the variables
artifactName/downloadDir and the subsequent gh commands) similar to how signtool
is validated: after each gh ... call, test $LASTEXITCODE and, if non-zero, write
an error message to the console (including the command and exit code) and exit
with that code; ensure you apply the same pattern to the other gh calls
referenced in the review to make failure handling deterministic.
- Line 9: Update the timestamp URL string to use HTTPS instead of HTTP by
changing the $TimestampUrl variable assignment (look for the
[string]$TimestampUrl declaration) so the timestamping uses
"https://timestamp.digicert.com"; ensure any code that consumes $TimestampUrl
continues to work with the new scheme (no additional behavioral changes
required).

ℹ️ Review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9ab9ebf and 0d8cfb7.

📒 Files selected for processing (3)
  • .github/workflows/release.yml
  • RELEASE.md
  • scripts/finalize-release.ps1

@nefarius nefarius merged commit 31ecde8 into master Feb 28, 2026
2 checks passed
@nefarius nefarius deleted the release-job branch February 28, 2026 14:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant