-
Notifications
You must be signed in to change notification settings - Fork 5
54 lines (47 loc) · 1.51 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
47
48
49
50
51
52
53
54
name: Create Release and publish pypi package
on:
push:
tags:
- v[0-9]+.[0-9]+.*
jobs:
released:
name: Released
if: github.ref_type == 'tag'
runs-on: ubuntu-latest
steps:
- name: Checkout git repo
uses: actions/checkout@v2
- name: Automated Version Bump
id: changelog
uses: Requarks/changelog-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{github.ref_name}}
writeToFile: 'false'
- name: Get variables
id: get_variables
run: |
echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
echo ::set-output name=IS_PRERELEASE::"${{contains(github.ref, 'dev')}}"
- name: Publish release github
uses: softprops/action-gh-release@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
prerelease: ${{ steps.get_variables.outputs.IS_PRERELEASE }}
tag_name: ${{ steps.get_variables.outputs.VERSION }}
body: ${{ steps.changelog.outputs.changes }}
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish python package
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*