Skip to content

Commit f3ca122

Browse files
committed
github: add build-and-release workflow
Run build-and-release for: - pushes with a tag - only if the unit test stage was successful Signed-off-by: Rouven Czerwinski <[email protected]>
1 parent 8f79e6b commit f3ca122

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: build and publish
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
branch:
7+
type: string
8+
required: false
9+
jobs:
10+
release:
11+
runs-on: ubuntu-22.04
12+
continue-on-error: false
13+
steps:
14+
- uses: actions/checkout@v3
15+
with:
16+
ref: ${{ inputs.branch }}
17+
- name: Set up Python
18+
uses: actions/setup-python@v4
19+
- name: Install python dependencies
20+
run: |
21+
python -m pip install --upgrade pip build
22+
- name: Build sdist
23+
run: |
24+
python -m build -s
25+
- name: Publish package
26+
uses: pypa/gh-action-pypi-publish@release/v1
27+
with:
28+
password: ${{ secrets.PYPI_API_TOKEN }}

.github/workflows/push-pr-unit-tests.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,8 @@ jobs:
1515
push-pr-unit-tests-docker:
1616
name: Docker Unit Tests
1717
uses: ./.github/workflows/reusable-unit-tests-docker.yml
18+
build-and-release:
19+
name: Release to Pypi
20+
needs: push-pr-unit-tests
21+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
22+
uses: ./.github/workflows/build-and-release.yml

0 commit comments

Comments
 (0)