Skip to content

ci(deploy): publish stable release on every main push#37

Merged
OpenSource-For-Freedom merged 3 commits into
mainfrom
ci/main-push-as-stable
Jun 7, 2026
Merged

ci(deploy): publish stable release on every main push#37
OpenSource-For-Freedom merged 3 commits into
mainfrom
ci/main-push-as-stable

Conversation

@OpenSource-For-Freedom

@OpenSource-For-Freedom OpenSource-For-Freedom commented Jun 7, 2026

Copy link
Copy Markdown
Owner

Summary

Two fixes plus a concurrency guard, so the next merge to main publishes a stable release that actually works and the site picks it up automatically.

1. Main pushes publish stable releases

Drops the v$NEXT-dev.$RUN_NUMBER prerelease path. Main pushes now emit v$nextStable with prerelease=false, make_latest=legacy. The wraithsec-site probe (which calls /releases/latest and ignores prereleases) starts tracking main within minutes of a merge, no manual tag step required. Tag-push runs unchanged — explicit backports / hotfixes still work.

2. Workflow concurrency to prevent tag races

Two overlapping main pushes could both compute the same $nextStable (neither tag exists at version-derivation time) and the second would fail at softprops/action-gh-release with "tag already exists". concurrency: { group: deploy-${{ github.ref }}, cancel-in-progress: false } queues the second run behind the first so it sees the just-published tag and picks the next patch.

3. Re-ship scanner/ + automation/ in the portable ZIP (regression from PR #36)

PR #36 trimmed the ZIP to just WRAITH.exe + README.md on the assumption that the csproj Content includes embedded the Python scanner and PowerShell automation scripts inside the single-file binary. They don't — CopyToOutputDirectory drops those trees ALONGSIDE the EXE in ./publish; the single-file bundler only ingests managed assemblies and native libs.

Result for portable-ZIP users: extract, double-click WRAITH.exe, hit Scan → every Python-backed scan fails with "Python scanner not found at <extract-dir>\scanner\scanner.py" because BootstrapService.ResolveBaseDir() joins "scanner" to the EXE dir and the ZIP had none.

The stage step now copies ./publish/scanner and ./publish/automation into ./release before Compress-Archive. Sourcing from ./publish means the csproj's existing Exclude pattern (test_*.py, __pycache__, *.pyc) automatically carries through — no duplicate filter to drift.

Still kept OUT of the ZIP (PR #36's "no raw repo junk" intent preserved): START.bat, quick-scan.ps1, wraith.env.json template, LICENSE, CI / test files. The portable ZIP is now exactly the runtime payload — nothing more.

Velopack installer path was never broken by PR #36 (it consumes ./publish-velopack which still includes the dirs via the same csproj rule), so the third fix is portable-ZIP-only.

Test plan

  • Merge this PR.
  • Watch the post-merge run: tag should be v$(next-patch), not v$(next-patch)-dev.N.
  • Download the new ZIP, extract, double-click WRAITH.exe, hit Scan → real scan output instead of "Python scanner not found".
  • Verify /releases/latest API endpoint returns the new tag, and wraithsec-site picks it up (sessionStorage 5 min, localStorage LKG 7 days — hard refresh to bypass).
  • Two close-together merges to main → second run queues behind first, no "tag already exists" failure.

Drops the dev-suffix prerelease path. Every push to main now produces a
stable v$next-patch release with make_latest=legacy, so the wraithsec-site
auto-update probe (which calls /releases/latest) tracks main within minutes
of a merge instead of stalling on the last manually-tagged release.

- Removes the v$NEXT-dev.$RUN_NUMBER prerelease build path.
- Removes the unused RUN_NUMBER env var from the derive-version step.
- Tag-triggered runs unchanged — explicit backports / hotfixes still work.
- Stale-VERSION guard still aborts when VERSION lags behind the highest tag.
- Header comment block rewritten to reflect new model.
Copilot AI review requested due to automatic review settings June 7, 2026 15:42

Copilot AI left a comment

Copy link
Copy Markdown

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 changes the deployment workflow so that every push to main publishes a stable GitHub Release (auto-incrementing the patch version within the major.minor line from VERSION) and marks it as “Latest” via GitHub’s SemVer comparison (make_latest: legacy). This aligns the repository’s /releases/latest behavior with the wraithsec-site probe so the site tracks main quickly without manual tagging.

Changes:

  • Switch main pushes from prerelease -dev.N tags to stable vX.Y.Z tags (prerelease=false, make_latest=legacy).
  • Remove the now-unused RUN_NUMBER from the version derivation logic.
  • Update the workflow header documentation and messaging to reflect the new stable-on-main release model.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

# probe (which calls /releases/latest) always sees the freshest stable within
# minutes of a merge — no manual tag step required.
#
# Tag pushes still work for explicit backports / hotfixes off a non-main branch.
Two overlapping main pushes could both compute the same $nextStable
(neither tag exists yet at version-derivation time), then race at the
softprops/action-gh-release step — the loser fails with "tag already
exists". Concurrency group=deploy-${ref}, cancel-in-progress=false
queues the second run so it sees the first run's published tag and
picks the next patch.

Tag-push runs are scoped by their unique tag ref so they never collide
with each other or with main pushes.
Copilot AI review requested due to automatic review settings June 7, 2026 15:56
@OpenSource-For-Freedom OpenSource-For-Freedom merged commit ab726e3 into main Jun 7, 2026
8 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

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 1 out of 1 changed files in this pull request and generated 1 comment.

Comment on lines 23 to 25
push:
branches: [ main ]
tags: [ 'v[0-9]+.[0-9]+.[0-9]+' ]
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.

2 participants