generated from deargen/python-project-template-2024
-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (48 loc) · 1.7 KB
/
deploy.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
name: Commit CHANGELOG.md, create a Release and deploy MkDocs
on:
workflow_dispatch:
inputs:
version-tag:
description: Version tag
required: true
default: v0.1.0
dry-run:
description: Dry run
type: boolean
default: false
exclude-types:
description: Commit types to exclude from the changelog
required: false
default: build,docs,style,other
jobs:
commit-changelog-and-release:
uses: deargen/workflows/.github/workflows/commit-changelog-and-release.yml@master
with:
version-tag: ${{ github.event.inputs.version-tag }}
dry-run: ${{ github.event.inputs.dry-run == 'true' }}
changelog-path: docs/CHANGELOG.md
exclude-types: ${{ github.event.inputs.exclude-types }}
deploy-mkdocs:
if: ${{ github.event.inputs.dry-run == 'false' }}
needs: commit-changelog-and-release
uses: deargen/workflows/.github/workflows/deploy-mkdocs.yml@master
with:
requirements-file: deps/lock/x86_64-manylinux_2_28/requirements_docs.txt
version-tag: ${{ github.event.inputs.version-tag }}
deploy-type: tag
publish-to-pypi:
if: ${{ github.event.inputs.dry-run == 'false' }}
needs: commit-changelog-and-release
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.version-tag }}
- uses: deargen/workflows/actions/setup-python-and-uv@master
- name: Build and upload to PyPI
run: |
uv venv
source .venv/bin/activate
uv pip install build twine
python -m build . --sdist
twine upload dist/* -u __token__ -p ${{ secrets.PYPI_API_TOKEN }} --non-interactive