Create new release #6
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Create new release | |
on: | |
workflow_dispatch: | |
branches: | |
- main | |
jobs: | |
create-release: | |
name: Publish new release | |
runs-on: ubuntu-latest | |
environment: pypi | |
permissions: | |
# IMPORTANT: this permission is mandatory for Trusted Publishing | |
id-token: write | |
# this permission is mandatory to create github releases | |
contents: write | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Install uv | |
uses: astral-sh/setup-uv@v5 | |
with: | |
python-version: '3.12' | |
- run: uv pip install hatch scriv commitizen | |
- name: Configure Git user | |
run: | | |
git config --global user.name "Frank Hoffman (ci)" | |
git config --global user.email "[email protected]" | |
- name: commit & tag release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
cz bump | |
git push --force-with-lease origin main $(git describe main --tags) | |
- name: build package | |
run: hatch build | |
- name: Publish package distributions to PyPI | |
uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # v1.12.4 | |
- name: create github release | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
run: scriv github-release |