Skip to content

ci: add tag-triggered GitHub release workflow with CPack zip#173

Merged
EmJayGee merged 8 commits into
mainfrom
micgrier/makerelease
Jun 14, 2026
Merged

ci: add tag-triggered GitHub release workflow with CPack zip#173
EmJayGee merged 8 commits into
mainfrom
micgrier/makerelease

Conversation

@EmJayGee

Copy link
Copy Markdown
Collaborator

Adds a tag-triggered release pipeline so we can publish GitHub Releases without any third-party actions.

What it does

  • New workflow .github/workflows/release.yml triggers on pushing a vX.Y.Z tag (and vX.Y.Z-* pre-release tags).
  • It builds the project in Release with vcpkg, packages everything into a .zip via CPack, and publishes a GitHub Release named after the tag with the zip attached and auto-generated notes.
  • Pre-release tags (e.g. v0.3.3-rc1) are automatically marked as pre-releases.

How to cut a release

git tag v0.3.3
git push origin v0.3.3

The project version already comes from this same tag (top-level CMake git describe --tags --match "v*"), so the build version and release name always match.

Notes

  • Uses only first-party actions plus the built-in gh CLI with the default GITHUB_TOKEN — nothing needs org allow-listing.
  • Wires include(CPack) into the top-level CMakeLists.txt (ZIP on Windows, TGZ elsewhere); the project previously never called it, so cpack had nothing to run.
  • Uses the portable ZIP packager because GitHub's Windows runners don't ship NSIS. An NSIS installer can be added later if desired.

Pushing a vX.Y.Z tag now builds the project in Release, packages everything into a .zip via CPack, and publishes a GitHub Release named after the tag with the zip attached and auto-generated notes. Pre-release tags (e.g. v0.3.3-rc1) are marked as pre-releases. Uses only first-party actions plus the gh CLI with the default GITHUB_TOKEN. Wires include(CPack) into the top-level CMakeLists (ZIP on Windows, TGZ elsewhere) so cpack can produce artifacts; the project previously never called include(CPack).

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

Adds a tag-triggered GitHub Actions workflow to build and package the project with CPack, then publish a GitHub Release for the pushed tag.

Changes:

  • Wire include(CPack) into the top-level CMake configuration and set basic CPack package metadata / generator selection.
  • Add .github/workflows/release.yml to build (Release), run CPack to produce a ZIP, and publish a GitHub Release (marking *-* tags as pre-releases).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
CMakeLists.txt Adds CPack configuration so CI can generate packaged artifacts via cpack.
.github/workflows/release.yml Introduces a tag-triggered release workflow that builds, packages, and publishes GitHub Releases.

Comment thread .github/workflows/release.yml
Comment thread .github/workflows/release.yml Outdated
Comment thread .github/workflows/release.yml Outdated
Address PR review: (1) GitHub tag filters are glob (minimatch), not regex, so the +-quantified patterns never matched normal vX.Y.Z tags; replace with the glob 'v[0-9]*' which covers releases and pre-releases. (2) Run bootstrap-vcpkg.bat and vcpkg.exe via shell: pwsh instead of bash so the batch/exe invocations work natively on windows-latest. (3) Correct the header comment: only the numeric X.Y.Z is extracted into PROJECT_VERSION, so a pre-release suffix like -rc1 is not reflected in the built version even though the release is named after the full tag.

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.

Comment thread .github/workflows/release.yml Outdated
Comment thread .github/workflows/release.yml
Address PR review: (1) Tighten the tag glob to 'v[0-9]*.[0-9]*.[0-9]*' so it requires the two dots of vX.Y.Z and no longer fires on tags like v1 or v12foo; the trailing segment still permits pre-release suffixes like -rc1. (2) Build the tests (build_tests=ON/BUILD_TESTING=ON) and run ctest before packaging, so a release artifact is never published if the suite the rest of CI runs is failing.

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 1 comment.

Comment thread .github/workflows/release.yml
The on.push.tags glob can only require the vX.Y.Z shape, not digits-only segments, so tags like v1foo.2.3 or v1.2.3.4 could still trigger a release. Add a first step that regex-validates github.ref_name against strict vMAJOR.MINOR.PATCH with optional -prerelease/+build suffixes and fails fast before any build/publish when it doesn't match.

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 3 comments.

Comment thread .github/workflows/release.yml Outdated
Comment thread .github/workflows/release.yml
Comment thread .github/workflows/release.yml Outdated
Address PR review: (1) Pin VCPKG_DEFAULT_TRIPLET/VCPKG_TARGET_TRIPLET to x64-windows (job env), pass --triplet x64-windows to vcpkg install, and add -A x64 plus -D VCPKG_TARGET_TRIPLET=x64-windows to the CMake configure so vcpkg, CMake, and the packaged artifact all agree on x64 and we never publish a 32-bit build or hit an arch mismatch. (2) Tighten the validation regex so MAJOR/MINOR/PATCH each match (0|[1-9][0-9]*), rejecting leading-zero segments like v01.2.3 to actually be strict SemVer as the step name claims.

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 1 comment.

Comment thread .github/workflows/release.yml Outdated
…ease configure

Address PR review: build_tests is not referenced anywhere in this project's CMake (only BUILD_TESTING is), so the cache variable was misleading; removed it. CMAKE_BUILD_TYPE has no effect with the Visual Studio multi-config generator selected by -A x64 (the config is chosen by --config/--build-config/-C Release), so removed it too and added a comment explaining the multi-config behavior.

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 1 comment.

Comment thread .github/workflows/release.yml
Pre-release detection treated any hyphen in the tag as a pre-release, but SemVer build metadata may legally contain hyphens (e.g. v1.2.3+build-foo) and such tags pass the semver gate. Strip everything from the first '+' (build metadata) before testing for a '-', so only a hyphen in the pre-release position marks the GitHub release as a pre-release.

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 1 comment.

Comment thread .github/workflows/release.yml Outdated
@EmJayGee EmJayGee merged commit b7b4b35 into main Jun 14, 2026
4 checks passed
@EmJayGee EmJayGee deleted the micgrier/makerelease branch June 14, 2026 05:22
@EmJayGee EmJayGee requested a review from Copilot June 14, 2026 05:23

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 1 comment.

Comment on lines +99 to +103
-A x64
-D CMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake
-D VCPKG_TARGET_TRIPLET=x64-windows
-D BUILD_TESTING=ON
-B ${{ steps.strings.outputs.build-output-dir }}
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