Prepare version 0.3.2 (#63) #33
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: Publish Python 🐍 distributions 📦 to TestPyPI | |
on: | |
push: | |
tags: | |
- 'v*.*.*' | |
permissions: | |
contents: read | |
jobs: | |
# Wheels no longer offered until library linking is clarified. | |
build: | |
name: Build Source distribution and Wheels | |
runs-on: ${{ matrix.os }} | |
strategy: | |
# fail-fast: false | |
matrix: | |
# os: [ "ubuntu-latest", "macos-latest", "windows-latest" ] | |
# python-version: [ "3.9", "3.10", "3.11", "3.12", "3.13" ] | |
include: | |
- os: ubuntu-latest | |
python-version: "3.x" | |
defaults: | |
run: | |
shell: bash -l {0} | |
steps: | |
- name: Harden Runner | |
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1 | |
with: | |
egress-policy: audit | |
- name: Checkout Repository | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
with: | |
fetch-depth: 0 | |
submodules: true | |
- name: Setup Python3 | |
id: pyinstalled | |
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0 | |
with: | |
python-version: ${{ matrix.python-version }} | |
# - name: Set up Python${{ matrix.python-version }} with NetCDF4 (conda) | |
# if: ${{ matrix.os == 'windows-latest' }} | |
# uses: mamba-org/provision-with-micromamba@main | |
# with: | |
# cache-downloads: true | |
# micromamba-version: 'latest' | |
# extra-specs: | | |
# python=${{ matrix.python-version }} | |
# build | |
# virtualenv | |
# - name: Install NetCDF4 (Ubuntu/apt) | |
# if: ${{ matrix.os == 'ubuntu-latest' }} | |
# run: | | |
# sudo apt-get update | |
# sudo apt-get install libnetcdf-dev | |
# - name: Install NetCDF4 (macOS/homebrew) | |
# if: ${{ matrix.os == 'macos-latest' }} | |
# uses: tecolicom/actions-use-homebrew-tools@v1 | |
# with: | |
# tools: netcdf | |
# cache: yes | |
- name: Install packaging libraries (Ubuntu/macOS) | |
if: ${{ matrix.os != 'windows-latest' }} | |
run: ${{ steps.pyinstalled.outputs.python-path }} -m pip install build virtualenv | |
# - name: Build a binary wheel (Windows) | |
# if: ${{ matrix.os == 'windows-latest' }} | |
# run: python -m build --wheel | |
# - name: Build a binary wheel (Ubuntu/macOS) | |
# if: ${{ matrix.os != 'windows-latest' }} | |
# run: ${{ steps.pyinstalled.outputs.python-path }} -m build --wheel | |
- name: Build a source tarball (Ubuntu) | |
if: | | |
(matrix.os == 'ubuntu-latest') && (matrix.python-version == '3.x') | |
run: ${{ steps.pyinstalled.outputs.python-path }} -m build --sdist | |
- uses: actions/upload-artifact@v4 | |
with: | |
path: | | |
dist/*.tar.gz | |
# dist/*.whl | |
if-no-files-found: error | |
publish-testpypi: | |
name: Publish Python 🐍 distributions 📦 to TestPyPI | |
needs: build | |
runs-on: ubuntu-latest | |
environment: staging | |
permissions: | |
# IMPORTANT: this permission is mandatory for trusted publishing | |
id-token: write | |
steps: | |
- name: Harden Runner | |
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1 | |
with: | |
egress-policy: audit | |
- name: Checkout Repository | |
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 | |
id: download | |
with: | |
name: artifact | |
path: dist | |
- name: Publish distribution 📦 to Test PyPI | |
uses: pypa/gh-action-pypi-publish@fb13cb306901256ace3dab689990e13a5550ffaa # v1.11.0 | |
with: | |
print-hash: true | |
repository-url: https://test.pypi.org/legacy/ | |
skip-existing: true |