Merge pull request 'Sync uv.lock on release to prevent CI failures' (#24) from cursor/sync-uv-lock-on-release into main
Reviewed-on: https://gitea.lille-vemmelund.dk/brian/python-repositories/pulls/24
This commit was merged in pull request #24.
This commit is contained in:
@@ -22,6 +22,16 @@ jobs:
|
||||
COMMIT_MSG: ${{ github.event.head_commit.message }}
|
||||
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
|
||||
if: steps.meta.outputs.bump != 'skip'
|
||||
id: bump
|
||||
@@ -45,7 +55,7 @@ jobs:
|
||||
run: |
|
||||
git config user.name "CI Bot"
|
||||
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 tag "v${VERSION}"
|
||||
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)).
|
||||
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.
|
||||
|
||||
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"
|
||||
|
||||
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
|
||||
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
|
||||
else
|
||||
echo "version=${VERSION}"
|
||||
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