mirror of
https://github.com/astral-sh/uv.git
synced 2026-06-23 08:51:43 -04:00
16a9cec5da
The release-preparation workflow exposes a contents- and pull-request-write `GITHUB_TOKEN` while running `rooster`. `rooster@0.1.1` was pinned, but `uvx` still resolved its transitive dependencies at runtime, so code outside the repository lock could execute with that token. Add a dedicated Python 3.12+ `release` dependency group containing `rooster==0.1.1`, commit its full dependency graph to `uv.lock`, and invoke it with `uv run --locked --python 3.12 --only-group release`.
36 lines
990 B
Bash
Executable File
36 lines
990 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
|
|
uv run --locked --python 3.12 --only-group release rooster 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 --no-config
|
|
|
|
echo "Generating JSON schema..."
|
|
cargo dev generate-json-schema
|
|
|
|
echo "Checking crates.io publish setup..."
|
|
uv run --no-config "$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)"
|