Skip to content

build-release: pin release tags to the tested commit, not the branch head #48

Description

@mairas

Problem

build-release.yml creates both releases with gh release create and no --target: the pre-release at line 407 and the draft stable release at line 502. GitHub then records target_commitish: main, a branch name, not the commit the run built and tested. halos-org/skip's releases show this: the draft v1.5.0+1 and the pre-release v1.5.0+1_pre both have target=main.

A release tag is created against the target when the release is published:

  • Draft stable release. The tag appears only when someone publishes the draft, on whatever main points to at that moment. "Delete previous draft releases" runs only in build-and-release, which needs the test job to succeed. So if a later merge's tests fail, the older draft stays. Publishing it then tags the later, untested commit.
  • Pre-release. The tag is created when the step runs, on main's head at that time. If another merge lands while the run is testing, the _pre tag points past the built commit.

For .deb repositories the attached package came from the right commit, so a misplaced tag mostly misleads. For repositories with build-deb: false and no registry publish, the tag is the release. halos-org/docs-tools is one: consumers install it by pinning git+https://github.com/halos-org/docs-tools@vX.Y.Z+N. There a misplaced tag ships code that CI never tested.

Proposed change

Pass --target "$GITHUB_SHA" to both gh release create calls so each tag points at the commit the run tested. Check that publishing a draft with an explicit SHA target creates the tag on that SHA even after main has moved on.

Found while reviewing halos-org/docs-tools#31.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions