Skip to content

Promote US Data Release #4

Promote US Data Release

Promote US Data Release #4

name: Promote US Data Release
on:
workflow_dispatch:
inputs:
run_id:
description: 'Run ID to promote (e.g. usdata-gha123456-a1)'
required: true
type: string
concurrency:
group: promote-us-data-release
cancel-in-progress: false
jobs:
promote-release:
runs-on: ubuntu-latest
permissions:
contents: write
env:
HUGGING_FACE_TOKEN: ${{ secrets.HUGGING_FACE_TOKEN }}
MODAL_TOKEN_ID: ${{ secrets.MODAL_TOKEN_ID }}
MODAL_TOKEN_SECRET: ${{ secrets.MODAL_TOKEN_SECRET }}
MODAL_ENVIRONMENT: main
US_DATA_MODAL_APP_PREFIX: us-data
US_DATA_RUN_ID: ${{ github.event.inputs.run_id }}
steps:
- name: Generate GitHub App token
id: app-token
uses: actions/create-github-app-token@v3
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}
- name: Checkout repo
uses: actions/checkout@v6
with:
token: ${{ steps.app-token.outputs.token }}
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.14'
- uses: astral-sh/setup-uv@v8.1.0
- name: Install promotion CLI deps
run: pip install modal towncrier
- name: Resolve run context
id: run-context
run: python .github/scripts/resolve_run_context.py
- name: Promote staged release to production
run: python .github/scripts/promote_publication_pipeline.py
- name: Finalize package version
run: |
python .github/scripts/restore_publication_changelog.py
python .github/scripts/finalize_package_version.py
towncrier build --yes --version "$US_DATA_RELEASE_VERSION"
uv lock
- name: Commit final package version
uses: EndBug/add-and-commit@v10
with:
add: "pyproject.toml uv.lock CHANGELOG.md changelog.d"
message: Finalize package version
- name: Build final wheel
run: |
uv sync --dev
uv run python -m build --wheel
- name: Publish final package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI }}
skip-existing: true
- name: Verify final PyPI version
run: python .github/scripts/verify_pypi_version.py