-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (42 loc) · 1.27 KB
/
bump-version-number.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
name: Bump version number
on:
workflow_dispatch:
inputs:
version_part:
type: choice
description: Part of version number to bump
options:
- patch
- minor
- major
jobs:
bump-version:
runs-on: ubuntu-latest
steps:
# Checkout repository, bump version with ./version.sh, and commit
- uses: actions/checkout@v2
with:
token: ${{ secrets.NANOME_BOT_PAT }}
- name: git setup
run: |
git config --global user.name 'nanome-bot'
git config --global user.email '[email protected]'
- name: Run version.sh
run: |
pip install bump2version
chmod +x ./version.sh
./version.sh ${{ github.event.inputs.version_part }}
- name: get new version number
id: new_version_number
run: |
new_ver=$(cat setup.cfg | grep current_version | awk -F "=" '{print $2}' | xargs)
echo "version_number=$new_ver" >> $GITHUB_OUTPUT
- name: Push to GitHub
run: |
git push --follow-tags
push-to-registry:
needs: bump-version
uses: ./.github/workflows/push-to-registry.yml
with:
tag: ${{needs.bump-version.outputs.version_number}}
secrets: inherit