Skip to content

Feat: automate GitHub releases (#11) #6

Feat: automate GitHub releases (#11)

Feat: automate GitHub releases (#11) #6

Workflow file for this run

name: Publish release
on:
workflow_dispatch:
push:
tags:
- "202[3-9].[0-9][0-9].[0-9]+"
- "202[3-9].[0-9][0-9].[0-9]+-rc[0-9]+"
defaults:
run:
shell: bash
jobs:
test:
uses: ./.github/workflows/pytest.yml
release:
runs-on: ubuntu-latest
environment: release
needs: test
permissions:
# https://github.com/softprops/action-gh-release#permissions
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: "3.11"
cache: pip
cache-dependency-path: "**/pyproject.toml"
- name: Install build dependencies
run: pip install build
- name: Build package
run: python -m build
- name: Release
uses: softprops/action-gh-release@v1
with:
files: |
./dist/*.tar.gz
./dist/*.whl
prerelease: ${{ contains(github.ref, '-rc') }}
generate_release_notes: ${{ !contains(github.ref, '-rc') }}