Merge pull request #215 from ImperialCollegeLondon/release-candidates… #41
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Create Release Candidate" | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
create-rc: | |
if: ${{ !contains(github.event.head_commit.message, 'release-candidates/') }} | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
pull-requests: write | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # Fetch all history | |
fetch-tags: true # Fetch all tags | |
ref: ${{ github.head_ref || github.ref_name }} # Correct branch reference | |
- name: Install uv & dependencies | |
uses: astral-sh/setup-uv@v5 | |
with: | |
# Install a specific version of uv. | |
version: "0.5.22" | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version-file: "pyproject.toml" | |
- name: Install project | |
run: | | |
uv sync --all-extras | |
- name: Bump version | |
id: bump | |
run: | | |
uv run semantic-release version --no-commit --no-tag --skip-build | |
VERSION=$(grep -o '".*"' pyprobe/_version.py | sed 's/"//g') | |
echo "version=$VERSION" >> $GITHUB_OUTPUT | |
- name: Update uv lockfile | |
run: uv lock --upgrade-package pyprobe-data | |
- name: Open Pull Request | |
uses: peter-evans/create-pull-request@v7 | |
with: | |
branch: release-candidates/rc-${{ steps.bump.outputs.version }} | |
title: "Release Candidate ${{ steps.bump.outputs.version }}" | |
commit-message: "chore: release candidate ${{ steps.bump.outputs.version }}" | |
base: main | |
body: "This PR is the release candidate for version ${{ steps.bump.outputs.version }}." |