-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (45 loc) · 1.53 KB
/
release.yml
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
name: Release
on:
workflow_dispatch:
inputs:
bump:
type: choice
description: How to bump the version
required: true
options:
- major
- minor
- patch
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.BOT_ACCESS_TOKEN }}
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- run: python -m pip install poetry
- run: poetry install --all-extras
- name: Configure git
run: |
git config --global user.name 'Release bot'
git config --global user.email '[email protected]'
git push
- name: bump release version and tag
run: |
poetry version ${{ github.event.inputs.bump }}
export NEW_VERSION=v$(poetry version -s)
git commit -am "Bumping to version $NEW_VERSION"
git tag -a $NEW_VERSION -m $NEW_VERSION
- name: prepatch to the next version
run: |
poetry version prepatch
export NEW_VERSION=v$(poetry version -s)
git commit -am "Prepatching to $NEW_VERSION"
- name: Push results
# See https://www.wearecogworks.com/blog/quick-guide-to-running-sub-workflows-with-github-actions/
run: |
git push "https://$GITHUB_ACTOR:${{ secrets.BOT_ACCESS_TOKEN }}@github.com/$GITHUB_REPOSITORY.git"
git push "https://$GITHUB_ACTOR:${{ secrets.BOT_ACCESS_TOKEN }}@github.com/$GITHUB_REPOSITORY.git" --tags