Skip to content

v0.0.71.dev1

v0.0.71.dev1 #114

Workflow file for this run

name: build
on:
push:
branches: [main]
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+a[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+b[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+rc[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+dev[0-9]+"
workflow_dispatch:
jobs:
check-commit-and-tag:
runs-on: ubuntu-latest
outputs:
match: ${{ steps.commit.outputs.match }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Check commit for version tag
id: commit
run: |
commit_message=$(git log --format=%B -n 1 ${{ github.event.after }})
tag_name=${{ github.event.ref }}
if [[ "$commit_message" =~ v[0-9]+.[0-9]+.[0-9]+.* ]] || [[ "$tag_name" =~ v[0-9]+.[0-9]+.[0-9]+.* ]]; then
echo "::set-output name=match::true"
else
echo "::set-output name=match::false"
fi
build:
name: Build and deploy to PyPI
needs: check-commit-and-tag
if: needs.check-commit-and-tag.outputs.match == 'true'
runs-on: "ubuntu-latest"
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: "100"
- uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install pypa/build
run: >-
python -m
pip install
build
--user
- name: Build a binary wheel and a source tarball
run: >-
python -m
build
--sdist
--wheel
--outdir dist/
.
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
verbose: true
password: ${{ secrets.PYPI_TOKEN }}