-
Notifications
You must be signed in to change notification settings - Fork 1
51 lines (46 loc) · 1.59 KB
/
tag.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
47
48
49
50
51
name: Tag Release
on:
push:
branches: [ master, main ]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Get previous release tag
id: previoustag
uses: "WyriHaximus/github-action-get-previous-tag@v1"
- name: Format previous release tag
id: tagformat
run: |
previous_tag=$(echo ${{steps.previoustag.outputs.tag}} | cut -c2-)
echo "::set-output name=previous_tag::$previous_tag"
- name: Bump release version
id: bump_version
uses: christian-draeger/[email protected]
with:
current-version: ${{ steps.tagformat.outputs.previous_tag }}
version-fragment: 'bug'
- name: Create Release
if: github.event_name == 'push'
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ steps.bump_version.outputs.next-version }}
release_name: Release v${{ steps.bump_version.outputs.next-version }}
draft: false
prerelease: false
- name: Build and deploy
if: github.event_name == 'push'
run: |
echo v${{ steps.bump_version.outputs.next-version }} > VERSION
pip install twine
python3 setup.py sdist bdist_wheel
python3 -m twine upload dist/*
env:
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}