Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions .github/workflows/builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
75 changes: 53 additions & 22 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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"
Expand Down Expand Up @@ -271,11 +300,13 @@ 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
uses: Mavergreen/shipyard/.github/workflows/publish-release.yml@v1
with:
version: ${{ needs.build.outputs.ver }}
artifact: codex-cli
product: codex-cli
release-mode: ${{ needs.version-check.outputs.mode }}
5 changes: 4 additions & 1 deletion INGREDIENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Loading