-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (41 loc) · 1.29 KB
/
publish.yaml
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
name: publish
on:
push:
branches:
- master
jobs:
publish:
name: Build and publish to PyPI
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.ACCESS_TOKEN }}
fetch-depth: 0
ref: master
- uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: 1.4.1
- name: Bump patch version
if: "! contains(github.event.head_commit.message, 'Auto-increment patch version')"
run: poetry version patch
- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Auto-increment patch version
- name: Build source and wheel archives
if: "contains(github.event.head_commit.message, 'Auto-increment patch version')"
run: |
poetry build
- name: Publish distribution 📦 to PyPI
if: "contains(github.event.head_commit.message, 'Auto-increment patch version')"
uses: pypa/gh-action-pypi-publish@v1.9.0
with:
password: ${{ secrets.PYPI_API_TOKEN }}
repository_url: https://upload.pypi.org/legacy/