-
-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (49 loc) · 1.85 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
53
54
55
56
57
58
59
60
# Official docs:
# - https://docs.github.com/en/actions
# - https://github.com/actions
name: PyPI Release
env:
POETRY_VERSION: "1.8.4"
on:
push:
tags:
# - "v*" # only run on tags that start with 'v'
- "[0-9]+.[0-9]+.[0-9]+" # matches tags in the format X.Y.Z
jobs:
build-and-release:
runs-on: ubuntu-latest
# permissions:
# id-token: write # IMPORTANT: this permission is mandatory for OIDC publishing
steps:
# https://github.com/actions/checkout
- name: Checkout code
uses: actions/checkout@v4
# https://github.com/actions/setup-python
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Which Python3
run: which python
- name: Install Poetry
# run: curl -sSL https://install.python-poetry.org | python3 - --version $POETRY_VERSION
run: pip install poetry==${{ env.POETRY_VERSION }}
- name: Install dependencies
run: poetry install --no-root
- name: Build package
run: poetry build
# - name: Publish distribution to Test PyPI
# uses: pypa/gh-action-pypi-publish@release/v1
# with:
# password: ${{ secrets.TEST_PYPI_API_TOKEN }}
# repository-url: https://test.pypi.org/legacy/
# https://github.com/pypa/gh-action-pypi-publish
# https://github.com/marketplace/actions/pypi-publish
# https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/
- name: Publish package to PyPI
uses: pypa/[email protected]
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
repository-url: https://test.pypi.org/legacy/