-
-
Notifications
You must be signed in to change notification settings - Fork 20
63 lines (54 loc) · 1.74 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
52
53
54
55
56
57
58
59
60
61
62
63
name: publish
on:
push:
branches: [ main ]
permissions:
contents: write
id-token: write
jobs:
release:
if: github.event_name == 'push' && github.ref == 'refs/heads/main' && !contains(github.event.head_commit.message, 'chore(release):')
runs-on: ubuntu-latest
steps:
- name: Setup | Checkout Project
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.sha }}
- name: Setup | Force Branch
run: |
git checkout -B ${{ github.ref_name }} ${{ github.sha }}
- name: Setup | Install Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Release | Python Semantic Release
id: release
uses: python-semantic-release/python-semantic-release@v9.10.0
with:
build: true
commit: true
push: true
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Publish | Build and Publish to PyPI using Poetry
if: steps.release.outputs.released == 'true'
uses: JRubics/poetry-publish@v2.0
with:
pypi_token: ${{ secrets.POETRY_PYPI_TOKEN_PYPI }}
- name: Release | Upload to GitHub Release Assets
uses: python-semantic-release/publish-action@v9.10.0
if: steps.release.outputs.released == 'true'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ steps.release.outputs.tag }}
docs:
runs-on: ubuntu-latest
steps:
- name: Setup | Checkout Project
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Docs | Install MKDocs
run: pip install mkdocs-material
- name: Docs | Publish Docs
run: mkdocs gh-deploy --force