Skip to content

Potential release process #21

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions .github/workflows/on_push_to_main_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
on:
push:
branches:
- main
paths-ignore:
- '**/.gitignore'
- '**/.github/workflows/on_pr*'
- '**/.github/workflows/precommit_updates.yml'
- '**/.pre-commit-config.yaml'

jobs:
bump:
## Bump the version, depending on what was in the last push
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

# Scan the commit message for a prefix or major/minor. Otherwise default to patch
- name: Determine bump type
id: bump_type
run: |
commit_message="$(git log --format=%B -n 1 ${{ github.sha }})"
# if it starts with major:, minor:, or patch:, use that
if [[ $commit_message =~ ^(major|minor|patch): ]]; then
echo "bump_type=${BASH_REMATCH[1]}" >> "$GITHUB_OUTPUT"
else
echo "bump_type=${BASH_REMATCH[1]}" >> "$GITHUB_OUTPUT"
fi

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.x

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install poetry
poetry install

- name: Bump version
run: |
poetry version "${{ steps.bump_type.outputs.bump_type }}"

# TODO: Needs tests...
# - name: poetry publish
# TODO: Sort out secrets