Skip to content

v2.0.1 release

v2.0.1 release #361

Workflow file for this run

# Publish archives to PyPI and TestPyPI using GitHub Actions
name: Publish to PyPI
# Only run for tagged releases and pushes to the development branch
on:
release:
types:
- published
push:
branches:
- development
# Trigger manually at https://github.com/icesat2py/icepyx/actions/workflows/publish_to_pypi.yml
workflow_dispatch:
permissions: {}
jobs:
build:
name: Build distribution 📦
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
# fetch all history so that setuptools-scm works
fetch-depth: 0
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
with:
python-version: '3.11'
- name: Install dependencies
run: python -m pip install build setuptools wheel
# This step is only necessary for testing purposes and for TestPyPI
- name: Fix up version string for TestPyPI
if: ${{ !startsWith(github.ref, 'refs/tags') }}
run: |
# Change setuptools-scm local_scheme to "no-local-version" so the
# local part of the version isn't included, making the version string
# compatible with PyPI.
sed --in-place "s/node-and-date/no-local-version/g" pyproject.toml
- name: Build source and wheel distributions
run: |
python -m build
echo ""
echo "Generated files:"
ls -lh dist/
- name: Store the distribution packages
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
with:
name: python-package-distributions
path: dist/
publish-to-testpypi:
name: Publish Python 🐍 distribution 📦 to TestPyPI
if: github.repository == 'icesat2py/icepyx'
needs:
- build
runs-on: ubuntu-latest
environment:
name: testpypi
url: https://test.pypi.org/project/icepyx
permissions:
id-token: write # IMPORTANT: mandatory for trusted OIDC publishing
steps:
- name: Download all the dists
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
with:
name: python-package-distributions
path: dist/
- name: Publish distribution 📦 to TestPyPI
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0
with:
repository-url: https://test.pypi.org/legacy/
publish-to-pypi:
name: Publish Python 🐍 distribution 📦 to PyPI
if: github.repository == 'icesat2py/icepyx' && startsWith(github.ref, 'refs/tags/')
needs:
- build
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/project/icepyx/
permissions:
id-token: write # IMPORTANT: mandatory for trusted OIDC publishing
steps:
- name: Download all the dists
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
with:
name: python-package-distributions
path: dist/
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0