Skip to content

Release on merge: derive the version, mint the tag, promote one artifact - #6

Merged
pbujna-apius merged 1 commit into
mainfrom
ci/simplify-release-flow
Aug 11, 2026
Merged

pbujna-apius merged 1 commit into
mainfrom
ci/simplify-release-flow

Conversation

@pbujna-apius

Copy link
Copy Markdown
Contributor

Why

Releases needed a human to push vX.Y.Z after merging the Release PR. Forgetting it produces no release at all, silently — apius_lang_entropy v1.0.3 sat merged and untagged until someone noticed. It also made the version a value typed twice (dispatch input, then tag name) with no cross-check.

What changed

resolve job (new) — derives the version from the stamped app.conf when the caller omits version, and decides whether there is anything to release:

  • tag-triggered run → always releases (legacy path, unchanged)
  • branch-triggered run → releases only when the resolved version has no tag yet

So ordinary pushes to main are no-ops, and a re-run cannot double-release.

The tag is minted, not pushed — gh release create --target <sha> creates it. A tag pushed with GITHUB_TOKEN does not trigger on: push: tags, so doing it in the run that already built the package avoids both the second event and a PAT. No new credentials.

One artifact, built once — splunkbase now downloads what release inspected instead of rebuilding. build_package normalizes ownership, but tarfile.open(..., "w:gz") writes a fresh gzip mtime, so the rebuilt tarball was never byte-identical to the one attached to the GitHub Release. The published bytes are now provably the inspected bytes.

current-version CLI command — reads back [launcher] version, sharing stamp_conf_version's stanza/key parsing so the release reads exactly what prepare-release wrote. Covered by tests, including that it ignores a version key in another stanza.

Not changed

The Splunkbase publish still sits behind the caller's splunkbase Environment approval, held before any step runs. Approve to publish; leave it unapproved and the GitHub Release stands with nothing uploaded.

Compatibility

version became optional rather than changing meaning. splunk-app-template and apius_splunk_qradare_integration keep their tag triggers and pass version explicitly, so they behave exactly as before and need no change. Only apius_lang_entropy migrates to the auto trigger (separate PR, with the ADR-0004 amendment).

Verification

pytest -q (10 passed), ruff check, ruff format --check all pass. Workflow YAML parsed and job graph checked: splunkbase needs [resolve, release] and its if avoids always(), so a skipped release correctly skips the publish.

The end-to-end auto path cannot be exercised until a caller is migrated — that is the follow-up PR, and its first real release is the test.

The release flow required a human to push the tag vX.Y.Z after merging the
Release PR. Forgetting it silently produced no release at all (apius_lang_entropy
v1.0.3 sat merged and untagged), and it made the version a value typed twice —
once into the prepare-release dispatch, once into the tag name.

release.yml now supports being triggered by the merge itself:

- New `resolve` job derives the version from the stamped app.conf (via a new
  `current-version` CLI command) when the caller omits `version`, and skips the
  release when that version is already tagged. Ordinary main pushes are no-ops
  and re-runs cannot double-release.
- The tag is created by `gh release create --target <sha>` instead of pushed
  from a job. A tag pushed with GITHUB_TOKEN does not trigger `on: push: tags`,
  so minting it inside the run that already built the package avoids both a
  second event and a PAT.
- The `splunkbase` job downloads the artifact the release job inspected instead
  of rebuilding it. build_package normalizes ownership, but tarfile's gzip
  header carries a fresh mtime, so the rebuild was never byte-identical to the
  tarball attached to the GitHub Release.

Backward compatible: `version` became optional rather than changing meaning, and
a tag-triggered caller passing it explicitly always releases, as before. This
keeps splunk-app-template and apius_splunk_qradare_integration working untouched.

The Splunkbase publish is unchanged and still gated on the caller's `splunkbase`
Environment approval.
@pbujna-apius
pbujna-apius requested a review from a team as a code owner August 11, 2026 10:45
@pbujna-apius
pbujna-apius merged commit 37b370d into main Aug 11, 2026
1 check passed
pbujna-apius added a commit to apius-tech/apius_lang_entropy that referenced this pull request Aug 11, 2026
)

Merging the "Release vX.Y.Z" PR left the repo stamped but inert until a
maintainer remembered to push the tag. When that was missed the whole pipeline
stayed green with nothing released — v1.0.3 sat merged and untagged.

The caller now runs on push to main and omits `version`, so the shared workflow
reads it from the stamped app.conf, skips the release when that version is
already tagged, and creates the tag itself alongside the GitHub Release.

A release is now two human actions: dispatch prepare-release with the version,
then approve the Splunkbase deployment. The Splunkbase gate is unchanged.

Requires apius-tech/splunk-app-ci#6 (makes `version` optional and adds the
version-resolution job); until that merges, @main still declares `version` as
required and this caller will not validate.
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