From 36880473ac6610b46c44e09a9bd20706c671c024 Mon Sep 17 00:00:00 2001 From: Hans-Martin von Gaudecker Date: Tue, 30 Jun 2026 19:09:41 +0200 Subject: [PATCH] Add PyPI publish workflow + changelog Add a GitHub Action that builds an sdist and wheel on every push and uploads them to PyPI on tagged releases (modeled on the dags/optimagic setup, but using PyPI trusted publishing / OIDC instead of a stored API token). fetch-depth: 0 so hatch-vcs can derive the version from git tags. Add CHANGES.md to track releases. Releasing: bump by pushing a version tag (e.g. `v0.1.0`); the workflow's publish step is gated on `refs/tags`. Requires a trusted publisher to be configured for the skillmodels project on PyPI (repo OpenSourceEconomics/skillmodels, workflow publish-to-pypi.yml). Co-Authored-By: Claude Opus 4.8 --- .github/workflows/publish-to-pypi.yml | 37 +++++++++++++++++++++++++++ CHANGES.md | 13 ++++++++++ 2 files changed, 50 insertions(+) create mode 100644 .github/workflows/publish-to-pypi.yml create mode 100644 CHANGES.md diff --git a/.github/workflows/publish-to-pypi.yml b/.github/workflows/publish-to-pypi.yml new file mode 100644 index 00000000..eb906f49 --- /dev/null +++ b/.github/workflows/publish-to-pypi.yml @@ -0,0 +1,37 @@ +--- +name: PyPI +on: push +jobs: + build-n-publish: + name: Build and publish Python 🐍 distributions 📦 to PyPI + runs-on: ubuntu-latest + # Trusted publishing (OIDC): the publish step mints a short-lived token from + # PyPI instead of using a stored API token, so `id-token: write` is required. + permissions: + id-token: write + steps: + - uses: actions/checkout@v6 + with: + # hatch-vcs derives the version from git tags, so the full history + # (including tags) must be fetched. + fetch-depth: 0 + - name: Set up Python 3.12 + uses: actions/setup-python@v6 + with: + python-version: '3.12' + - name: Install pypa/build + run: >- + python -m + pip install + build + --user + - name: Build a binary wheel and a source tarball + run: >- + python -m + build + --sdist + --wheel + --outdir dist/ + - name: Publish distribution 📦 to PyPI + if: startsWith(github.ref, 'refs/tags') + uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/CHANGES.md b/CHANGES.md new file mode 100644 index 00000000..894ba875 --- /dev/null +++ b/CHANGES.md @@ -0,0 +1,13 @@ +# Changes + +This is a record of all past skillmodels releases and what went into them in reverse +chronological order. We follow [semantic versioning](https://semver.org/) and all +releases are available on [PyPI](https://pypi.org/project/skillmodels/). + +## 0.1 + +- Add the Antweiler–Freyberger (AF) sequential MLE and the Attanasio–Meghir–Nix (AMN) + estimators alongside the existing CHS Kalman filter, with a shared control-function + correction, a public measurement-family interface on `ModelSpec`, and the AF + source/destination calendar adapter. +- Add a GitHub Action to build and publish the package to PyPI on tagged releases.