Skip to content

Commit

Permalink
Add a GiHub actions workflow for releases
Browse files Browse the repository at this point in the history
  • Loading branch information
bnjmnp committed May 7, 2023
1 parent 01e41de commit 600d48f
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/release_triggerd_build_and_upload_to_pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@

name: Build PySOEM sdist and wheels and upload them to PyPI

# This is triggerd upon creating a release on GitHub.
on:
release:
types: [published]

jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, windows-2019]

steps:
- uses: actions/checkout@v3
with:
submodules: recursive

- name: Build wheels
uses: pypa/[email protected]

- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl

build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Build sdist
run: pipx run build --sdist

- uses: actions/upload-artifact@v3
with:
path: ./dist/*.tar.gz

upload_pypi:
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest

steps:
- uses: actions/download-artifact@v3
with:
name: artifact
path: dist

- uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.PYPI_PYSOEM_ACCESS_TOKEN }}

0 comments on commit 600d48f

Please sign in to comment.