-
Notifications
You must be signed in to change notification settings - Fork 1
49 lines (46 loc) · 1.19 KB
/
python-publish.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
name: Upload Python Package
on:
workflow_dispatch:
release:
types: [published]
permissions:
contents: read
jobs:
deploy:
strategy:
fail-fast: false
matrix:
python-version: ["3.10"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install poetry
run: pipx install poetry
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: 'poetry'
- name: poetry self add "poetry-dynamic-versioning[plugin]"
shell: bash
run: |
set -eux
poetry self add "poetry-dynamic-versioning[plugin]"
- name: Install
shell: bash
run: |
poetry install
- name: Publish Dry Run
if: ${{github.event_name != 'release'}}
shell: bash
run: |
set -eux
poetry publish --build --dry-run
- name: Publish
if: ${{github.event_name == 'release'}}
shell: bash
env:
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_API_TOKEN }}
run: |
set -eux
poetry publish --build