Skip to content

Ci/release workflow#9

Merged
virtexalejandro merged 3 commits intomainfrom
ci/release-workflow
Apr 28, 2026
Merged

Ci/release workflow#9
virtexalejandro merged 3 commits intomainfrom
ci/release-workflow

Conversation

@virtexalejandro
Copy link
Copy Markdown
Contributor

Ci/release workflow

…ICENSES at install root

Apache 2.0 §4(d) requires the NOTICE file to ship in any binary
distribution.  The existing install rules covered headers, libs,
binaries, and the CMake package config but did not include the
top-level legal/docs files.  Anyone shipping a release archive built
from cmake --install was relying on a manual copy step (which is what
v0.1.0 did) -- this commit makes the install tree self-contained.

Files installed at the install prefix root, matching the layout of
vtx-sdk-0.1.0-windows-x64.zip:

  LICENSE
  NOTICE
  README.md
  CHANGELOG.md
  SECURITY.md
  THIRD_PARTY_LICENSES.md
Triggered by pushing a v*.*.* tag (or via manual workflow_dispatch).
Builds, packages, and uploads 6 assets to the GitHub release for the
tag:

  vtx-sdk-<version>-linux-x64.tar.gz       + .sha256
  vtx-sdk-<version>-windows-x64.zip        + .sha256
  vtx-samples-<version>.zip                + .sha256

Linux SDK package: libs + vtx_cli + headers + legal/docs (Apache
NOTICE, LICENSE, README, CHANGELOG, SECURITY, THIRD_PARTY_LICENSES).
Windows SDK package: same plus vtx_inspector + vtx_schema_creator.
Samples package: source-only zip of samples/ for users to build
standalone against an installed SDK.

Pre-flight in derive-version aborts before the build matrix if:
  - Tag X.Y.Z component disagrees with project(VTX_SDK VERSION ...)
    in CMakeLists.txt.
  - CHANGELOG.md is missing a '## [Unreleased]' section, or that
    section is empty.

The release body is sourced from '## [Unreleased]', with the heading
rewritten to '## [<version>] - <YYYY-MM-DD>' so published releases
keep the same shape as v0.1.0 ('[0.1.0] - 2026-04-24' etc.).

After publishing, the publish job rotates CHANGELOG.md on main: the
just-released entries move into '## [<version>] - <date>', and a
fresh empty '## [Unreleased]' is inserted on top so the next dev
cycle starts clean.  The bot commit carries [skip ci] to avoid
retriggering build.yml on a docs-only change.  Push retries 3x with
rebase on conflict; if it still fails (branch protection, race), the
workflow logs a warning without failing -- the release is already
out and rotation can be done manually.

Re-runnable: if the release for the tag already exists, the workflow
refreshes the body via gh release edit and replaces assets via
gh release upload --clobber instead of failing.
Default GITHUB_TOKEN can be silently downgraded to read-only by the
repo's "Workflow permissions" setting at Settings → Actions → General.
When that setting is restrictive (or hidden by an org policy), the
publish job's gh release create / git push for CHANGELOG rotation
both fail with a 403.

Switch the publish job to RELEASE_PAT, a fine-grained PAT with
Contents: Read and write configured as a repo secret.  Used in two
places:

  - actions/checkout@v4 with: token: -- the credentials baked into
    git config carry through to the rotation step's git push.
  - GH_TOKEN env on the release create/upload/edit steps.

Other jobs (derive-version, build-linux, build-windows,
package-samples) continue to use the default token: they only do
read-only operations (checkout + read files) so no PAT is needed.
@virtexalejandro virtexalejandro merged commit b69a366 into main Apr 28, 2026
9 checks passed
@virtexalejandro virtexalejandro deleted the ci/release-workflow branch April 28, 2026 14:04
virtexalejandro added a commit that referenced this pull request Apr 28, 2026
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.

1 participant