Skip to content

Update targeted childcare tax credit criteria (#1605) #385

Update targeted childcare tax credit criteria (#1605)

Update targeted childcare tax credit criteria (#1605) #385

Workflow file for this run

# Workflow that runs on versioning metadata updates.
# Uses GITHUB_TOKEN (not a personal PAT) for same-repo operations.
# Cross-repo API updates require POLICYENGINE_GITHUB secret (org-level PAT).
name: Versioning updates
on:
push:
branches:
- main
paths:
- changelog.d/**
- pyproject.toml
workflow_dispatch:
permissions:
contents: write
jobs:
Versioning:
runs-on: ubuntu-latest
if: |
(!(github.event.head_commit.message == 'Update package version'))
outputs:
committed: ${{ steps.commit.outputs.committed }}
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install uv
uses: astral-sh/setup-uv@v5
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Install towncrier
run: uv pip install towncrier --system
- name: Bump version and build changelog
run: |
python .github/bump_version.py
towncrier build --yes --version $(python -c "import re; print(re.search(r'version = \"(.+?)\"', open('pyproject.toml').read()).group(1))")
- name: Update changelog
id: commit
uses: EndBug/add-and-commit@v9
with:
add: "."
message: Update package version
Publish:
runs-on: ubuntu-latest
needs: Versioning
if: needs.Versioning.outputs.committed == 'true'
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
ref: main
- name: Install uv
uses: astral-sh/setup-uv@v5
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.13'
- name: Install package
run: uv pip install -e .[dev] --system
- name: Install policyengine
run: uv pip install policyengine --system
- name: Install Wheel and Pytest
run: pip3 install wheel setuptools pytest==5.4.3
- name: Publish a git tag
run: ".github/publish-git-tag.sh"
- name: Build package
run: make
- name: Publish a Python distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI }}
skip_existing: true
- name: Update API
run: |
if [ -n "$CROSS_REPO_TOKEN" ]; then
GITHUB_TOKEN="$CROSS_REPO_TOKEN" python .github/update_api.py
else
echo "Skipping cross-repo API update (POLICYENGINE_GITHUB secret not set)"
fi
env:
CROSS_REPO_TOKEN: ${{ secrets.POLICYENGINE_GITHUB }}