Skip to content

Commit

Permalink
github: add build-and-release workflow
Browse files Browse the repository at this point in the history
Run build-and-release for:
- pushes with a tag
- only if the unit test stage was successful

Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
  • Loading branch information
Emantor committed Dec 2, 2022
1 parent 58b2a8c commit 9710730
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/build-and-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: build and publish

on:
workflow_call:
inputs:
branch:
type: string
required: false
jobs:
release:
runs-on: ubuntu-22.04
continue-on-error: false
steps:
- uses: actions/checkout@v3
with:
ref: ${{ inputs.branch }}
- name: Set up Python
uses: actions/setup-python@v4
- name: Install python dependencies
run: |
python -m pip install --upgrade pip build
- name: Build sdist
run: |
python -m build -s
- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
5 changes: 5 additions & 0 deletions .github/workflows/push-pr-unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,8 @@ jobs:
push-pr-unit-tests-docker:
name: Docker Unit Tests
uses: ./.github/workflows/reusable-unit-tests-docker.yml
build-and-release:
name: Release to Pypi
needs: push-pr-unit-tests
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: ./.github/workflows/build-and-release.yml

0 comments on commit 9710730

Please sign in to comment.