Skip to content

Commit 688100f

Browse files
authored
chore: fix Rust release process so generated .tar.gz source works with Homebrew (#1423)
Looking at existing releases such as https://github.com/openai/codex/releases/tag/codex-rs-b289c9207090b2e27494545d7b5404e063bd86f3-1-rust-v0.1.0-alpha.4, the `.tar.gz` for the source code still seems to have `0.0.0` as the `version` in `codex-rs/Cargo.toml` instead of what the tag seems to say it should have: https://github.com/openai/codex/blob/b289c9207090b2e27494545d7b5404e063bd86f3/codex-rs/Cargo.toml#L21 ChatGPT claims: > When GitHub generates the Source code (tar.gz) archive for a tag: • It uses the commit the tag points to. • But in some cases (e.g., shallow clones, GitHub CI, or local tools that only clone the default branch), that commit may not be included, and you might get an outdated view or nothing at all depending on how it’s fetched. Trying this recommended fix.
1 parent f30bf4b commit 688100f

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

codex-rs/scripts/create_github_release.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,19 @@ else
2828
VERSION=$(printf '0.0.%d' "$(date +%y%m%d%H%M)")
2929
fi
3030
TAG="rust-v$VERSION"
31+
RELEASE_BRANCH="release/$TAG"
32+
3133
git checkout -b "$TAG"
3234
perl -i -pe "s/^version = \".*\"/version = \"$VERSION\"/" Cargo.toml
3335
git add Cargo.toml
3436
git commit -m "Release $VERSION"
3537
git tag -a "$TAG" -m "Release $VERSION"
38+
39+
# The commit identified by the tag must be reachable from a branch so that
40+
# when GitHub creates the `Source code (tar.gz)` for the release, it can find
41+
# the commit. This is a requirement for Homebrew to be able to install the
42+
# package from the tarball.
43+
git push origin "$RELEASE_BRANCH"
3644
git push origin "refs/tags/$TAG"
45+
3746
git checkout "$CURRENT_BRANCH"

0 commit comments

Comments
 (0)