Skip to content
Merged
Show file tree
Hide file tree
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
45 changes: 41 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,55 @@
name: Release

on:
push:
tags:
- "v*"
release:
types: [published]

jobs:
bump-version:
runs-on: ubuntu-latest
permissions:
contents: write

steps:
- uses: actions/checkout@v4
with:
ref: master

- name: Get version from release tag
id: version
run: |
VERSION=${GITHUB_REF_NAME#v}
echo "version=$VERSION" >> $GITHUB_OUTPUT

- name: Update version in pyproject.toml
run: |
sed -i 's/^version = ".*"/version = "${{ steps.version.outputs.version }}"/' pyproject.toml

- name: Update version in __init__.py
run: |
sed -i 's/^__version__ = ".*"/__version__ = "${{ steps.version.outputs.version }}"/' src/fizzy/__init__.py

- name: Commit and push
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add pyproject.toml src/fizzy/__init__.py
git commit -m "Bump version to ${{ steps.version.outputs.version }}"
git push

release:
needs: bump-version
runs-on: ubuntu-latest
permissions:
id-token: write # For trusted publishing to PyPI
id-token: write

steps:
- uses: actions/checkout@v4
with:
ref: master

- name: Pull latest changes
run: git pull origin master

- name: Set up Python
uses: actions/setup-python@v5
Expand Down
38 changes: 0 additions & 38 deletions .github/workflows/version-bump.yml

This file was deleted.