This repository has been archived by the owner on May 31, 2024. It is now read-only.
Add support for Python 3.12 and prep v0.2.0. (#35) #8
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: Release | |
on: | |
push: | |
tags: | |
- v[0-9]+.[0-9]+.[0-9]+ | |
workflow_dispatch: | |
inputs: | |
tag: | |
description: The tag to manually run a deploy for. | |
required: true | |
jobs: | |
determine-tag: | |
name: Determine the release tag to operate against. | |
runs-on: ubuntu-22.04 | |
outputs: | |
release-tag: ${{ steps.determine-tag.outputs.release-tag }} | |
release-version: ${{ steps.determine-tag.outputs.release-version }} | |
steps: | |
- name: Determine Tag | |
id: determine-tag | |
run: | | |
if [[ -n "${{ github.event.inputs.tag }}" ]]; then | |
RELEASE_TAG=${{ github.event.inputs.tag }} | |
else | |
RELEASE_TAG=${GITHUB_REF#refs/tags/} | |
fi | |
if [[ "${RELEASE_TAG}" =~ ^v[0-9]+.[0-9]+.[0-9]+$ ]]; then | |
echo "release-tag=${RELEASE_TAG}" >> $GITHUB_OUTPUT | |
echo "release-version=${RELEASE_TAG#v}" >> $GITHUB_OUTPUT | |
else | |
echo "::error::Release tag '${RELEASE_TAG}' must match 'v\d+.\d+.\d+'." | |
exit 1 | |
fi | |
pypi: | |
name: Publish sdist and wheel to PyPI | |
runs-on: ubuntu-22.04 | |
environment: Release | |
needs: determine-tag | |
steps: | |
- name: Checkout ${{ needs.determine-tag.outputs.release-tag }} | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ needs.determine-tag.outputs.release-tag }} | |
- name: Setup Python 3.9 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.9 | |
- name: Publish ${{ needs.determine-tag.outputs.release-tag }} | |
uses: pantsbuild/actions/run-tox@e63d2d0e3c339bdffbe5e51e7c39550e3bc527bb | |
env: | |
FLIT_USERNAME: ${{ secrets.PYPI_USERNAME }} | |
FLIT_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | |
with: | |
tox-env: publish |