File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11name : Release
22
33on :
4+ release :
5+ types :
6+ - " published"
47 push :
58 branches :
69 - main
7- tags :
8- - " v*"
910 pull_request :
1011 branches :
1112 - ' main'
1213
1314jobs :
15+ pypi :
16+ runs-on : ubuntu-latest
17+
18+ steps :
19+ - uses : actions/checkout@v2
20+
21+ - name : Set up Python 3.7
22+ uses : actions/setup-python@v2
23+ with :
24+ python-version : 3.7
25+
26+ - name : Install and configure Poetry
27+ uses : snok/install-poetry@v1
28+ with :
29+ virtualenvs-in-project : true
30+
31+ - name : Install dependencies
32+ run : poetry install --no-interaction --no-ansi
33+
34+ - name : Build package
35+ run : poetry build
36+
37+ - name : Publish package
38+ if : github.event_name == 'release'
39+ env :
40+ PYPI_USERNAME : __token__
41+ PYPI_TOKEN : ${{ secrets.PYPI_TOKEN }}
42+ run : poetry publish --build -u "${PYPI_USERNAME}" -p "${PYPI_TOKEN}"
43+
1444 docker :
1545 runs-on : ubuntu-latest
1646 steps :
4272 uses : docker/build-push-action@v4
4373 with :
4474 context : .
45- push : ${{ github.event_name != 'pull_request ' }}
75+ push : ${{ github.event_name == 'release ' }}
4676 provenance : false
4777 platforms : linux/amd64,linux/arm64
4878 tags : ${{ steps.meta.outputs.tags }}
You can’t perform that action at this time.
0 commit comments