-
Notifications
You must be signed in to change notification settings - Fork 1
51 lines (47 loc) · 1.15 KB
/
publish.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: Publish to PyPI
# on manually trigger
on:
workflow_dispatch:
inputs:
scope:
description: Release scope
required: true
default: minor
type: choice
options:
- major
- minor
- patch
jobs:
check:
uses: ./.github/workflows/checks.yml
secrets: inherit
publish:
needs: [check]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: 3.8
cache: "pip"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
pip install twine
pip install ".[ci]"
- name: Bump version and commit change
run: |
semantic-release version --${{ github.event.inputs.scope }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build and publish
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: |
python -m build
python -m twine upload dist/*