Skip to content

Commit edca667

Browse files
committed
Add PyPi publish step to CI
1 parent 6f0e5c8 commit edca667

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

.github/workflows/workflow_actions.yml

+38
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ on:
88
# Triggers the workflow on push or pull request events but only for the "main" branch
99
pull_request: []
1010
push:
11+
tags:
12+
- '*'
1113
branches:
1214
- 'main'
1315
# Allows you to run this workflow manually from the Actions tab
@@ -111,3 +113,39 @@ jobs:
111113
poetry run make doctest
112114
poetry run make linkcheck
113115
116+
117+
build_release:
118+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
119+
needs: build
120+
runs-on: ubuntu-22.04
121+
122+
steps:
123+
- uses: actions/checkout@v3
124+
125+
- name: Install Poetry
126+
run: curl -sSL https://install.python-poetry.org | python - --version 1.6.1
127+
128+
- name: Poetry build
129+
run: poetry build
130+
131+
- uses: actions/upload-artifact@v3
132+
with:
133+
name: pypi-build
134+
path: ./dist
135+
136+
publish:
137+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
138+
needs: build_release
139+
runs-on: ubuntu-22.04
140+
environment:
141+
name: pypi-publish
142+
url: https://pypi.org/project/cfspopcon/
143+
permissions:
144+
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
145+
steps:
146+
- uses: actions/download-artifact@v3
147+
with:
148+
name: pypi-build
149+
150+
- name: Publish package distributions to PyPI
151+
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)