-
Notifications
You must be signed in to change notification settings - Fork 3
52 lines (45 loc) · 1.23 KB
/
bump.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
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