Skip to content

Commit

Permalink
Merge pull request #189 from ImperialCollegeLondon/semantic-versionin…
Browse files Browse the repository at this point in the history
…g-pr-worflow

Replace auto publishing with workflow to create an rc PR
  • Loading branch information
tomjholland authored Jan 1, 2025
2 parents 53ef755 + 57b9de6 commit d3d6b9a
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 73 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/create-release-candidate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: "Create Release Candidate"

on:
push:
branches:
- main

jobs:
create-rc:
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

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version-file: "pyproject.toml"

- name: Install project
run: |
uv sync --all-extras --group format --group test --group docs --group external-integration
- 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@v4
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 }} [skip ci]"
base: main
body: "This PR is the release candidate for version ${{ steps.bump.outputs.version }}."
73 changes: 0 additions & 73 deletions .github/workflows/publish-to-testpypi.yml

This file was deleted.

0 comments on commit d3d6b9a

Please sign in to comment.