-
Notifications
You must be signed in to change notification settings - Fork 22
70 lines (60 loc) · 1.76 KB
/
release.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
64
65
66
67
68
69
70
name: Release
on:
push:
branches:
- master
jobs:
release:
name: Release
runs-on: ubuntu-latest
outputs:
release_created: ${{ steps.release.outputs.release_created }}
steps:
- uses: googleapis/release-please-action@v4
id: release
with:
release-type: python
- uses: actions/checkout@v4
if: ${{ steps.release.outputs.release_created }}
with:
fetch-depth: 2
- name: Set up Python
if: ${{ steps.release.outputs.release_created }}
uses: actions/setup-python@v4
with:
python-version: '3.8' # keep in sync with dev-env.yml
- name: Upgrade pip
if: ${{ steps.release.outputs.release_created }}
run: |
pip install --upgrade pip
pip --version
- name: Install Poetry
if: ${{ steps.release.outputs.release_created }}
run: |
pip install 'poetry==1.8.3' # keep version in sync with dev-env.yml
poetry --version
- name: Build package
if: ${{ steps.release.outputs.release_created }}
run: |
poetry build --ansi -n
- uses: actions/upload-artifact@v4
if: ${{ steps.release.outputs.release_created }}
with:
name: dist
path: dist/
upload_pypi:
needs: release
runs-on: ubuntu-latest
if: ${{ needs.release.outputs.release_created }}
environment: release
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
steps:
- name: Get artifacts
uses: actions/download-artifact@v4
with:
merge-multiple: true
path: dist
- name: Publish package on PyPI
uses: pypa/[email protected]