Merge pull request #174 from havogt/fix_license_ref #24
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy Python Distribution | |
on: | |
push: | |
branches: [master] | |
pull_request: | |
branches: [master] | |
release: | |
types: [published] | |
workflow_dispatch: | |
jobs: | |
build: | |
name: Build Python distribution | |
runs-on: ubuntu-latest | |
container: "ghcr.io/gridtools/gridtools-base:gcc-9-ucx-mpi-atlas-parmetis" | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python 3.10 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.10" | |
- name: Install pypa/build | |
run: | | |
python -m pip install build --user | |
- name: Build source tarball | |
run: | | |
python -m build --sdist --outdir dist/ | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ghex-dist | |
path: ./dist/** | |
# publish-pypi: | |
# name: Publish Python distribution to pypi.org | |
# runs-on: ubuntu-latest | |
# needs: build | |
# if: ${{ github.event_name == 'workflow_dispatch' }} # the action was triggered manually | |
# environment: | |
# name: pypi | |
# url: https://pypi.org/project/ghex | |
# permissions: | |
# id-token: write | |
# steps: | |
# - name: Download wheel | |
# uses: actions/download-artifact@v3 | |
# with: | |
# name: ghex-dist | |
# path: dist | |
# - name: Publish distribution to PyPI | |
# uses: pypa/gh-action-pypi-publish@release/v1 | |
publish-test-pypi: | |
name: Publish Python distribution to test.pypi.org | |
runs-on: ubuntu-latest | |
needs: build | |
if: ${{ github.event_name == 'workflow_dispatch' }} # TODO: once working, enable line below | |
# if: ${{ github.event_name == 'release' }} # triggered by releasing on github, test first before manually triggering the deployment to PyPI (see release documentation) | |
environment: | |
name: testpypi | |
url: https://test.pypi.org/project/ghex/ | |
permissions: | |
id-token: write | |
steps: | |
- name: Download wheel | |
uses: actions/download-artifact@v4 | |
with: | |
name: ghex-dist | |
path: dist | |
- name: Publish distribution to Test PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
repository-url: https://test.pypi.org/legacy/ |