Upload geocat-comp to PyPI #49
Workflow file for this run
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: Upload geocat-comp to PyPI | |
on: | |
workflow_dispatch: | |
jobs: | |
test-build: | |
if: github.repository == 'NCAR/geocat-comp' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5.4.0 | |
with: | |
python-version: '3.10' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install build twine check-manifest | |
- name: Build tarball and wheels | |
run: | | |
python -m build | |
python -m pip wheel . -w dist --no-deps | |
- name: Test the artifacts | |
run: | | |
python -m twine check dist/* | |
publish: | |
needs: test-build | |
if: startsWith(github.ref, 'refs/tags') | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5.4.0 | |
with: | |
python-version: '3.10' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install build twine check-manifest | |
- name: Build tarball and wheels | |
run: | | |
python -m build | |
python -m pip wheel . -w dist --no-deps | |
- name: Test the artifacts | |
run: | | |
python -m twine check dist/* | |
- name: Publish package to PyPI | |
uses: pypa/gh-action-pypi-publish@v1.12.4 | |
with: | |
skip-existing: true | |
verbose: true |