Upgrade GitHub workflows (#267) #1
Workflow file for this run
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
name: CD | |
on: | |
push: | |
tags: | |
- '[0-9]+.[0-9]+.[0-9]+' | |
- '[0-9]+.[0-9]+.[0-9]+(a|b|rc|post|dev)[0-9]+' | |
jobs: | |
prerequisites: | |
uses: ./.github/workflows/test.yml | |
release: | |
needs: [prerequisites] | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
python-version: ["3.11"] | |
runs-on: ${{ matrix.os }} | |
permissions: | |
# Write permissions are needed to create OIDC tokens. | |
id-token: write | |
# Write permissions are needed to make GitHub releases. | |
contents: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip setuptools wheel | |
python -m pip install build | |
- name: Build package | |
run: python -m build | |
# We rely on a trusted publisher configuration being present on PyPI, | |
# see https://docs.pypi.org/trusted-publishers/. | |
- name: Publish to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
- name: GH release | |
uses: softprops/action-gh-release@v2 | |
with: | |
body: > | |
Please see | |
https://github.com/${{ github.repository }}/blob/${{ github.ref_name }}/CHANGELOG.rst | |
for the full release notes. | |
draft: false | |
prerelease: false | |