Sync uv.lock on release to keep CI clean.
Run uv lock during version bumps and commit the lockfile in the release workflow. Co-authored-by: Cursor <[email protected]>
This commit is contained in:
co-authored by
Cursor
parent
a049ce327c
commit
ac487d91f8
@@ -22,6 +22,16 @@ jobs:
|
|||||||
COMMIT_MSG: ${{ github.event.head_commit.message }}
|
COMMIT_MSG: ${{ github.event.head_commit.message }}
|
||||||
run: scripts/ci/parse-merge-commit.sh "$COMMIT_MSG"
|
run: scripts/ci/parse-merge-commit.sh "$COMMIT_MSG"
|
||||||
|
|
||||||
|
- name: Set up Python
|
||||||
|
if: steps.meta.outputs.bump != 'skip'
|
||||||
|
uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version-file: .python-version
|
||||||
|
|
||||||
|
- name: Install uv
|
||||||
|
if: steps.meta.outputs.bump != 'skip'
|
||||||
|
run: pip install uv
|
||||||
|
|
||||||
- name: Bump version
|
- name: Bump version
|
||||||
if: steps.meta.outputs.bump != 'skip'
|
if: steps.meta.outputs.bump != 'skip'
|
||||||
id: bump
|
id: bump
|
||||||
@@ -45,7 +55,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
git config user.name "CI Bot"
|
git config user.name "CI Bot"
|
||||||
git config user.email "[email protected]"
|
git config user.email "[email protected]"
|
||||||
git add pyproject.toml
|
git add pyproject.toml uv.lock
|
||||||
git commit -m "chore: release v${VERSION} [skip ci]"
|
git commit -m "chore: release v${VERSION} [skip ci]"
|
||||||
git tag "v${VERSION}"
|
git tag "v${VERSION}"
|
||||||
git remote set-url origin "https://x-access-token:${CI_RUNNER_TOKEN}@${GITHUB_SERVER_URL#https://}/${GITHUB_REPOSITORY}.git"
|
git remote set-url origin "https://x-access-token:${CI_RUNNER_TOKEN}@${GITHUB_SERVER_URL#https://}/${GITHUB_REPOSITORY}.git"
|
||||||
|
|||||||
@@ -125,7 +125,7 @@ Releases are automated when a pull request is merged to `main`. CI reads the **m
|
|||||||
|
|
||||||
1. Open a PR targeting `main` (see [`.gitea/PULL_REQUEST_TEMPLATE.md`](.gitea/PULL_REQUEST_TEMPLATE.md)).
|
1. Open a PR targeting `main` (see [`.gitea/PULL_REQUEST_TEMPLATE.md`](.gitea/PULL_REQUEST_TEMPLATE.md)).
|
||||||
2. If the PR changes files under `python_repositories/`, the title **must** start with a version bump prefix (enforced by CI).
|
2. If the PR changes files under `python_repositories/`, the title **must** start with a version bump prefix (enforced by CI).
|
||||||
3. On merge, [`release.yml`](.gitea/workflows/release.yml) bumps [`pyproject.toml`](pyproject.toml), commits, tags `vX.Y.Z`, creates a Gitea release with auto-generated notes, and pushes the tag.
|
3. On merge, [`release.yml`](.gitea/workflows/release.yml) bumps [`pyproject.toml`](pyproject.toml) and syncs [`uv.lock`](uv.lock), commits, tags `vX.Y.Z`, creates a Gitea release with auto-generated notes, and pushes the tag.
|
||||||
4. [`publish.yml`](.gitea/workflows/publish.yml) builds and publishes the package to the Gitea Package Registry.
|
4. [`publish.yml`](.gitea/workflows/publish.yml) builds and publishes the package to the Gitea Package Registry.
|
||||||
|
|
||||||
Docs-, CI-, and test-only PRs do not need a prefix and will not trigger a release.
|
Docs-, CI-, and test-only PRs do not need a prefix and will not trigger a release.
|
||||||
|
|||||||
@@ -28,10 +28,17 @@ fi
|
|||||||
|
|
||||||
set_pyproject_version "$VERSION"
|
set_pyproject_version "$VERSION"
|
||||||
|
|
||||||
|
if command -v uv >/dev/null 2>&1; then
|
||||||
|
uv lock
|
||||||
|
else
|
||||||
|
echo "uv not found; uv.lock was not updated" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ -n "${GITHUB_OUTPUT:-}" ]]; then
|
if [[ -n "${GITHUB_OUTPUT:-}" ]]; then
|
||||||
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
|
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
|
||||||
else
|
else
|
||||||
echo "version=${VERSION}"
|
echo "version=${VERSION}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Updated pyproject.toml to version ${VERSION}" >&2
|
echo "Updated pyproject.toml and uv.lock to version ${VERSION}" >&2
|
||||||
|
|||||||
Reference in New Issue
Block a user