-
-
Notifications
You must be signed in to change notification settings - Fork 4
52 lines (44 loc) · 1.2 KB
/
release.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
# Requires GitHub secrets
# - GH_TOKEN
# - PYPI_TOKEN
name: Release
on:
push:
branches: ["main"]
jobs:
release:
name: Release
runs-on: ubuntu-latest
concurrency: release
permissions:
id-token: write
contents: write
steps:
- name: Checkout repository
id: checkout-repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Python
id: install-python
uses: actions/setup-python@v5
with:
python-version: 3.12
architecture: x64
- name: Install dependencies
id: install-dependencies
run: |
python -m pip install -U poetry twine
python -m poetry install --only main
- name: Semantic release
id: semantic-release
uses: python-semantic-release/python-semantic-release@master
with:
github_token: ${{ secrets.GH_TOKEN }}
- name: Build package
id: build-package
run: python -m poetry build
- name: Publish package
id: publish-package
run: |
python -m poetry run twine upload dist/* -u __token__ -p ${{ secrets.PYPI_TOKEN }} --skip-existing --verbose