diff --git a/.github/workflows/build-ubuntu20.yml b/.github/workflows/build-ubuntu20.yml index fc02549..bde8a02 100644 --- a/.github/workflows/build-ubuntu20.yml +++ b/.github/workflows/build-ubuntu20.yml @@ -6,11 +6,11 @@ on: ref: description: Git ref to build required: true - default: v1.1.0 + default: v2.0.1 version: description: Orbbec camera version without the v prefix required: true - default: 1.1.0 + default: 2.0.1 permissions: contents: read @@ -24,6 +24,14 @@ jobs: RELEASE_VERSION: ${{ inputs.version }} BUILD_REF: ${{ inputs.ref }} steps: + - name: Verify release branch and inputs + shell: bash + run: | + if [[ "${GITHUB_REF_NAME}" != "master" || ! "${RELEASE_VERSION}" =~ ^2\.[0-9]+\.[0-9]+(-[0-9A-Za-z.-]+)?$ || "${BUILD_REF}" != "v${RELEASE_VERSION}" ]]; then + echo "Dispatch this workflow from master using a pushed v2.x version tag and matching version." >&2 + exit 1 + fi + - name: Install system tools run: | apt-get update @@ -55,6 +63,12 @@ jobs: - uses: actions/checkout@v6 with: ref: ${{ inputs.ref }} + fetch-depth: 0 + + - name: Verify tag ancestry + run: | + test "$(git rev-parse HEAD)" = "$(git rev-parse "refs/tags/${BUILD_REF}^{commit}")" + git merge-base --is-ancestor HEAD "${GITHUB_SHA}" - name: Install uv and Python 3.12 run: | diff --git a/RELEASING.md b/RELEASING.md index ce1e365..a13dd6d 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -63,10 +63,11 @@ Before upload, verify the CLI and a real snapshot, inspect ELF dependencies and ## GitHub Actions and publication -Push the annotated version tag to the upstream repository. From the default -branch, manually run **Build Ubuntu 20.04 binary** with that tag as `ref` and -the package version as `version`. This also builds maintenance tags on -`stable/1.x`. Download the archive and checksum from the successful Actions +Merge and push the annotated version tag to the upstream repository first. +Manually run **Build Ubuntu 20.04 binary** from `master` for a Forge 2 +release, with the existing `v2.x` release tag as `ref` and the matching +package version as `version`. The workflow checks that the tag belongs to the +dispatch branch. Download the archive and checksum from the successful Actions run, validate them, and attach both to the GitHub Release for the tag. The workflow uploads an Actions artifact. A branch merge, a tag push, or a