Skip to content

Commit

Permalink
feat: Bump workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
mrkbac committed Aug 17, 2023
1 parent 6b5c22e commit 55b1a0a
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/bump.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Bump

on:
workflow_dispatch:
inputs:
version:
description: 'Version'
required: true
default: 'patch'
type: choice
options:
- major
- minor
- patch

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

steps:
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"

- name: Install hatch
run: python3 -m pip install --upgrade hatch

- name: Bump, commit, tag and push
run: |
git config --global user.name 'autobump'
git config --global user.email 'autobump'
VERSION=`hatch version`
hatch version ${{ inputs.version }}
NEW_VERSION=`hatch version`
git add ./src/kappe/__init__.py
git commit -m "Bump version: $VERSION → $NEW_VERSION"
git tag "v$NEW_VERSION"
git push
git push --tags
echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV
- name: Create draft release
uses: ncipollo/release-action@v1
with:
name: Release $NEW_VERSION
tag: v$NEW_VERSION
draft: true

0 comments on commit 55b1a0a

Please sign in to comment.