Merge pull request #1092 from SFDO-Tooling/release-v4 #51
This file contains 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
# based on CumulusCI's release.yml | |
name: Release snowfakery | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- snowfakery/__about__.py | |
workflow_dispatch: | |
concurrency: publishing | |
jobs: | |
publish-to-pypi: | |
name: Publish new release to PyPI | |
runs-on: SFDO-Tooling-Ubuntu | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python 3.11 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.11 | |
cache: pip | |
- name: Set up uv | |
uses: SFDO-Tooling/setup-uv@main | |
with: | |
version: "0.5.0" | |
enable-cache: true | |
- name: Build source tarball and binary wheel | |
run: uv tool run hatch build -c | |
- name: Upload to PyPI | |
run: uv tool run hatch publish | |
env: | |
HATCH_INDEX_USER: "__token__" | |
HATCH_INDEX_AUTH: ${{ secrets.PYPI_TOKEN }} | |
- name: Create release | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
VERSION="$(uv tool run hatch version)" | |
gh release create "v$VERSION" \ | |
dist/*.whl \ | |
dist/*.tar.gz \ | |
--title $VERSION |