Some checks failed
Security Scan / dependency-check (push) Failing after 38s
Security Scan / security (push) Successful in 46s
Test Suite / lint (push) Failing after 37s
Release / test (push) Failing after 22s
Release / build-and-release (push) Has been skipped
Test Suite / test (3.11) (push) Successful in 1m36s
Test Suite / build (push) Has been skipped
62 lines
1.6 KiB
YAML
62 lines
1.6 KiB
YAML
name: Create Release
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
bump_type:
|
|
description: 'Version bump type'
|
|
required: true
|
|
type: choice
|
|
options:
|
|
- patch
|
|
- minor
|
|
- major
|
|
|
|
jobs:
|
|
bump-and-release:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: write
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
with:
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: '3.11'
|
|
|
|
- name: Bump version
|
|
id: bump
|
|
run: |
|
|
python bump_version.py ${{ github.event.inputs.bump_type }}
|
|
NEW_VERSION=$(grep -oP 'version = "\K[^"]+' pyproject.toml)
|
|
echo "version=$NEW_VERSION" >> $GITHUB_OUTPUT
|
|
echo "tag=v$NEW_VERSION" >> $GITHUB_OUTPUT
|
|
|
|
- name: Commit and tag
|
|
run: |
|
|
git config user.name "github-actions[bot]"
|
|
git config user.email "github-actions[bot]@users.noreply.github.com"
|
|
git add pyproject.toml
|
|
git commit -m "bump version to v${{ steps.bump.outputs.version }}"
|
|
git tag v${{ steps.bump.outputs.version }}
|
|
|
|
- name: Push changes
|
|
run: |
|
|
git push origin main
|
|
git push origin v${{ steps.bump.outputs.version }}
|
|
|
|
- name: Create GitHub Release
|
|
uses: actions/create-release@v1
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
tag_name: v${{ steps.bump.outputs.version }}
|
|
release_name: Release v${{ steps.bump.outputs.version }}
|
|
draft: false
|
|
prerelease: false
|