name: Release
on:
push:
branches:
- main
permissions:
actions: write
contents: write
issues: write
pull-requests: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Set up Rust
uses: dtolnay/rust-toolchain@stable
- name: Install release dependencies
run: |
python -m pip install --upgrade pip python-semantic-release hatch
pip install -e .[dev]
- name: Run Rust tests
run: cargo test
- name: Run Python tests (no Stata)
run: pytest -v -m "not requires_stata"
- name: Release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: semantic-release version
- name: Publish to PyPI
uses: actions/github-script@v7
with:
script: |
await github.rest.actions.createWorkflowDispatch({
owner: context.repo.owner,
repo: context.repo.repo,
workflow_id: "publish.yml",
ref: context.ref
})