Files
Zanie Blue edc1beb69a Use trusted publishing for crates.io (#18709)
Moves from a crates.io API key to trusted publishing.

Setup of trusted publishing is automated via a script which creates the
trust relationship and disables publish by API key. The main breakage
here is that now, when we add a new crate, a release will fail. The
script is invoked during `release.sh` to catch this case and supports
creating a stub crate so the release can subsequently succeed — but this
will require the release author to have a local crates.io API key with
permissions to create projects and configure publishing. I tested this
script a few times end-to-end, but would not be surprised if it bites us
in the future.
2026-03-25 09:15:44 -05:00

36 lines
939 B
Bash
Executable File

#!/usr/bin/env bash
# Prepare for a release
#
# All additional options are passed to `rooster`
set -eu
script_root="$(realpath "$(dirname "$0")")"
project_root="$(dirname "$script_root")"
echo "Updating metadata with rooster..."
cd "$project_root"
# Update the changelog
uvx --python 3.12 rooster@0.1.1 release "$@"
# Bump library crate versions
uv run "$project_root/scripts/bump-workspace-crate-versions.py"
echo "Updating crate READMEs..."
uv run "$project_root/scripts/generate-crate-readmes.py"
echo "Updating lockfiles..."
cargo update -p uv
pushd crates/uv-trampoline; cargo update -p uv-trampoline; popd
uv lock
echo "Generating JSON schema..."
cargo dev generate-json-schema
echo "Checking crates.io publish setup..."
uv run "$project_root/scripts/setup-crates-io-publish.py" --quiet
echo "Creating release branch..."
git checkout -b "release/$(uv version --short)"
git commit -am "Bump version to $(uv version --short)"