From 4e09e89894b786f27769358d02e26db5c9253070 Mon Sep 17 00:00:00 2001 From: Leif Denby Date: Tue, 9 Jun 2026 15:02:39 +0200 Subject: [PATCH 1/2] Add ci action for package build and pypi upload --- .github/workflows/pypi-release.yml | 49 ++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 .github/workflows/pypi-release.yml diff --git a/.github/workflows/pypi-release.yml b/.github/workflows/pypi-release.yml new file mode 100644 index 0000000..65f9d8c --- /dev/null +++ b/.github/workflows/pypi-release.yml @@ -0,0 +1,49 @@ +### CI actions are pinned to immutable commit hashes, not mutable tags, to reduce supply-chain risk and help prevent LLM-based CI attacks. See https://github.com/lirantal/pypi-security-best-practices#13-secure-your-cicd-release-pipeline. +name: publish to pypi + +on: + workflow_dispatch: + release: + types: + - published + +jobs: + build: + name: build package + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + with: + fetch-depth: 0 + fetch-tags: true + + - uses: astral-sh/setup-uv@d4b2f3b6ecc6e67c4457f6d3e41ec42d3d0fcb86 # v5.4.2 + with: + enable-cache: true + + - run: uv build + + - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 + with: + name: package-dist + path: dist/* + + publish: + name: publish package to PyPI + needs: build + if: github.event_name == 'release' && github.event.action == 'published' + runs-on: ubuntu-latest + environment: pypi + permissions: + id-token: write + steps: + - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 + with: + name: package-dist + path: dist + + # Requires PyPI Trusted Publishing to be configured for this GitHub + # repository/workflow/environment on pypi.org. The `id-token: write` + # permission above lets this action request an OIDC token, in place of a + # PYPI_TOKEN repository secret. + - uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # 1.14.0 From 5c27fbf08bd6d0338a7fa35b8ffd9341bbbd4749 Mon Sep 17 00:00:00 2001 From: Leif Denby Date: Tue, 9 Jun 2026 15:06:21 +0200 Subject: [PATCH 2/2] changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7180e61..80047be 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Store dataset properties as netCDF-safe individual attributes while keeping read compatibility with legacy `attrs["properties"]` dict/JSON data. [\#21](https://github.com/mlwp-tools/mxalign/pull/21) @observingClouds - Added CI test workflow with first unit tests. [\#21](https://github.com/mlwp-tools/mxalign/pull/21) @observingClouds - Added optional `ifs` dependency group with `cfgrib`, `eccodes`, and `eccodeslib`. [\#21](https://github.com/mlwp-tools/mxalign/pull/21) @observingClouds +- Added CI action for package build and upload to pypi.org on releases. [\#28](https://github.com/mlwp-tools/mxalign/pull/28) @leifdenby ## [0.1.0](https://github.com/mlwp-tools/mxalign/releases/tag/v0.1.0)