-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (36 loc) · 1.11 KB
/
deploy.yml
File metadata and controls
44 lines (36 loc) · 1.11 KB
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
name: Deploy
on:
push:
pull_request:
workflow_dispatch:
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v3
- name: Install Poetry
run: pipx install poetry
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"
cache: "poetry"
- name: Build sdist
run: |
rm -rf dist # just in case
poetry build -f sdist
- name: Check Tag # SemVer + PEP 440
id: check-tag
run: |
if [[ ${{ github.ref }} =~ ^refs\/tags\/[0-9]+\.[0-9]+\.[0-9]+(a[0-9]+|b[0-9]+|rc[0-9]+)?(\.post[0-9]+)?(\.dev[0-9]+)?$ ]]; then
echo 'match=true' >>$GITHUB_OUTPUT
fi
- name: Publish to PyPI
if: steps.check-tag.outputs.match == 'true'
env:
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }}
run: poetry publish --no-interaction
- name: Publish to PyPI (dry-run)
if: steps.check-tag.outputs.match != 'true'
run: poetry publish --no-interaction --dry-run