-
Notifications
You must be signed in to change notification settings - Fork 1
56 lines (49 loc) · 1.6 KB
/
workflow.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
55
56
name: Version Bump and Publish to PyPI
on:
push:
branches:
- main
jobs:
bump_version:
if: "!startsWith(github.event.head_commit.message, 'bump:')"
runs-on: ubuntu-latest
name: "Bump version and create changelog with commitizen"
steps:
- id: get-github-app-token
name: Get GitHub App Token
uses: getsentry/[email protected]
with:
app_id: ${{ secrets.ORG_AUTOMATOR_ID }}
private_key: ${{ secrets.ORG_AUTOMATOR_KEY }}
- id: check-out
name: Check out
uses: actions/checkout@v2
with:
fetch-depth: 0
token: "${{ steps.get-github-app-token.outputs.token }}"
- id: cz
name: Bump and changelog using commitizen
uses: commitizen-tools/[email protected]
with:
github_token: ${{ steps.get-github-app-token.outputs.token }}
- id: print-version
name: Print Version
run: echo "Bumped to version ${{ steps.cz.outputs.version }}"
build:
needs: bump_version # Only runs after bump_version job completes successfully
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: pip install setuptools wheel twine
- name: Build package
run: python setup.py sdist bdist_wheel
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}