diff --git a/.github/workflows/builds.yml b/.github/workflows/builds.yml index 80530e7..ee0d638 100644 --- a/.github/workflows/builds.yml +++ b/.github/workflows/builds.yml @@ -92,15 +92,9 @@ jobs: push|workflow_dispatch) if [ "$GITHUB_REF" = refs/heads/main ]; then pub="$wanted"; fi ;; esac printf '%s\n' "$id" > BUILD_ID - # The test pkg's own version, YYYYMMDD.N, as release.yml computes it; CMake reads VERSION + # The test pkg's own version, YYYYMMDD.N, as release.yml derives it; CMake reads VERSION # for the updater, so it is written before configuring. - base="$(tr -d '[:space:]' < UPSTREAM_VERSION)" - maxn=0 - for t in $(git tag --list "$base.*"); do - n="${t##*.}" - case "$n" in ''|*[!0-9]*) : ;; *) [ "$n" -gt "$maxn" ] && maxn="$n" ;; esac - done - pkgver="$base.$((maxn + 1))" + pkgver="$(sh "$SHIPYARD_SCRIPTS/release-version.sh" --product codex-cli --mode auto)" printf '%s\n' "$pkgver" > VERSION { echo "id=$id"; echo "next=$next"; echo "codex=$codex"; echo "state=$state" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 67e58f3..1f85af7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -28,7 +28,54 @@ concurrency: cancel-in-progress: ${{ github.event_name == 'pull_request' }} jobs: + # spec: INGREDIENTS.md "Versioning" -- self-upstream-date: shipyard's release-version.sh derives + # YYYYMMDD.N, and check-release-version.sh checks it and its committed notes. Only a dispatch + # publishes, and only when release-needed.sh says the declared state is unreleased. + version-check: + runs-on: ubuntu-latest + timeout-minutes: 10 + permissions: + contents: read + outputs: + tag: ${{ steps.tag.outputs.tag }} + publish: ${{ steps.tag.outputs.publish }} + mode: ${{ steps.tag.outputs.mode }} + steps: + - uses: actions/checkout@v7 + with: + fetch-depth: 0 + persist-credentials: false + + - name: Install mavericks-shipyard + uses: Mavergreen/shipyard/.github/actions/install@v1 + + - name: Derive and check the version, and decide whether to publish + id: tag + env: + LOCAL_RELEASE: ${{ inputs.local_release }} + GH_TOKEN: ${{ github.token }} + run: | + set -eu + mode="$(sh "$SHIPYARD_SCRIPTS/release-mode.sh")" + t="$(sh "$SHIPYARD_SCRIPTS/release-version.sh" --product codex-cli --mode "$mode")" + pub=no + if [ "$GITHUB_EVENT_NAME" = workflow_dispatch ]; then + if [ "$LOCAL_RELEASE" = true ]; then + pub=yes + else + digest="$(sh "$SHIPYARD_SCRIPTS/release-state.sh")" + answer="$(sh "$SHIPYARD_SCRIPTS/release-needed.sh" --digest "$digest" --version "$t")" + echo "release-needed: $answer" + if [ "$answer" = PUBLISH ]; then pub=yes; fi + fi + fi + sh "$SHIPYARD_SCRIPTS/check-release-version.sh" --product codex-cli --version "$t" --sha "$GITHUB_SHA" \ + --mode "$mode" --publishing "$pub" + { echo "tag=$t"; echo "publish=$pub"; echo "mode=$mode"; } >> "$GITHUB_OUTPUT" + echo "version=$t publish=$pub mode=$mode" + build: + needs: version-check runs-on: macos-26 timeout-minutes: 45 outputs: @@ -52,31 +99,13 @@ jobs: run: sh "$SHIPYARD_SCRIPTS/assert-tree-clean.sh" --record # CMake reads VERSION for the updater, so it is written before configuring. - - name: Version (YYYYMMDD.N) + publish decision + - name: Version (YYYYMMDD.N) + publish decision, from version-check id: ver env: - LOCAL_RELEASE: ${{ inputs.local_release }} - GH_TOKEN: ${{ github.token }} + ver: ${{ needs.version-check.outputs.tag }} + pub: ${{ needs.version-check.outputs.publish }} run: | set -eu - base="$(tr -d '[:space:]' < UPSTREAM_VERSION)" - maxn=0 - for t in $(git tag --list "$base.*"); do - n="${t##*.}" - case "$n" in ''|*[!0-9]*) : ;; *) [ "$n" -gt "$maxn" ] && maxn="$n" ;; esac - done - ver="$base.$((maxn + 1))" - pub=no - if [ "$GITHUB_EVENT_NAME" = workflow_dispatch ]; then - if [ "$LOCAL_RELEASE" = true ]; then - pub=yes - else - digest="$(sh "$SHIPYARD_SCRIPTS/release-state.sh")" - answer="$(sh "$SHIPYARD_SCRIPTS/release-needed.sh" --digest "$digest" --version "$ver")" - echo "release-needed: $answer" - if [ "$answer" = PUBLISH ]; then pub=yes; fi - fi - fi printf '%s\n' "$ver" > VERSION { echo "ver=$ver"; echo "publish=$pub"; } >> "$GITHUB_OUTPUT" echo "version=$ver publish=$pub" @@ -271,7 +300,7 @@ jobs: # publish-release.yml creates the release with GitHub's default, so the pkg becomes the repo's # Latest; the codex-builds release is created with --latest=false and never takes it. publish: - needs: [build, scan, on-mavericks] + needs: [version-check, build, scan, on-mavericks] if: needs.build.outputs.publish == 'yes' permissions: contents: write @@ -279,3 +308,5 @@ jobs: with: version: ${{ needs.build.outputs.ver }} artifact: codex-cli + product: codex-cli + release-mode: ${{ needs.version-check.outputs.mode }} diff --git a/INGREDIENTS.md b/INGREDIENTS.md index 7d5a530..c6b5e64 100644 --- a/INGREDIENTS.md +++ b/INGREDIENTS.md @@ -293,9 +293,12 @@ a Codex bump updates it here along with the DIGEST in `components/codex/version` - **Biometric user verification reports unsupported** (0004), because it needs LocalAuthentication and Secure Enclave APIs, which 10.9 lacks. It cannot be turned on. +## Versioning + +- self-upstream-date + ## Conformance deviations -- scheme: the package is its own upstream (Codex reaches users through the builds channel, pinned in components/codex/version), so it versions itself by date as YYYYMMDD.N with no -mavericks.N axis - builds-channel: Codex builds are signed and published to this repo's codex-builds release by build/channel-publish.sh from .github/workflows/builds.yml, not by shipyard, until shipyard has machinery for a builds channel - unpinned:build/channel-publish.sh: before it publishes a build whose metadata names a min-pkg, it reads this repo's own Latest release, because the check is that the pkg the build needs is already offered to users, which only the newest release can say; a pin would be the very staleness it guards against. Reconsider if shipyard's builds-channel machinery takes over that check diff --git a/release-notes/20261127.1/changes/unified-toolchains-and-versioning b/release-notes/20261127.1/changes/unified-toolchains-and-versioning new file mode 100644 index 0000000..33b609b --- /dev/null +++ b/release-notes/20261127.1/changes/unified-toolchains-and-versioning @@ -0,0 +1 @@ +The package is now built with the same compilers on every host, and each release carries its own notes. The launcher, installer and updater work as before.