Skip to content

Only publish when there's a git tag #49

Only publish when there's a git tag

Only publish when there's a git tag #49

Workflow file for this run

name: "Python CI"
on:
push:
pull_request:
jobs:
format-check:
runs-on: "ubuntu-latest"
strategy:
matrix:
python-version: ["3.10", "3.11"]
steps:
- uses: "actions/checkout@v2"
- name: "Set up Python ${{ matrix.python-version }}"
uses: "actions/setup-python@v2"
with:
python-version: "${{ matrix.python-version }}"
- name: "Install"
run: "make install"
- name: "Format check"
run: "make format-check"
itest:
runs-on: "ubuntu-latest"
strategy:
matrix:
python-version: ["3.10", "3.11"]
steps:
- uses: "actions/checkout@v2"
- name: "Set up Python ${{ matrix.python-version }}"
uses: "actions/setup-python@v2"
with:
python-version: "${{ matrix.python-version }}"
- name: "Install"
run: "make install"
- name: "Integration test"
run: "make itest"
lint:
runs-on: "ubuntu-latest"
strategy:
matrix:
python-version: ["3.10", "3.11"]
steps:
- uses: "actions/checkout@v2"
- name: "Set up Python ${{ matrix.python-version }}"
uses: "actions/setup-python@v2"
with:
python-version: "${{ matrix.python-version }}"
- name: "Install"
run: "make install"
- name: "Lint"
run: "make lint"
publish-pypi:
runs-on: "ubuntu-latest"
needs:
- "format-check"
- "itest"
- "lint"
- "type-check"
- "utest"
# Only publish tagged versions.
# TODO: Add a check to ensure that the git tag matches the version.
if: "startsWith(github.ref, 'refs/tags/')"
permissions:
id-token: write
strategy:
matrix:
python-version: ["3.10", "3.11"]
steps:
- uses: "actions/checkout@v2"
- name: "Set up Python ${{ matrix.python-version }}"
uses: "actions/setup-python@v2"
with:
python-version: "${{ matrix.python-version }}"
- name: "Install"
run: "make install"
- name: "Install"
run: "make build"
- name: "Upload package to PyPI"
uses: "pypa/gh-action-pypi-publish@release/v1"
type-check:
runs-on: "ubuntu-latest"
strategy:
matrix:
python-version: ["3.10", "3.11"]
steps:
- uses: "actions/checkout@v2"
- name: "Set up Python ${{ matrix.python-version }}"
uses: "actions/setup-python@v2"
with:
python-version: "${{ matrix.python-version }}"
- name: "Install"
run: "make install"
- name: "Type check"
run: "make type-check"
utest:
runs-on: "ubuntu-latest"
strategy:
matrix:
python-version: ["3.10", "3.11"]
steps:
- uses: "actions/checkout@v2"
- name: "Set up Python ${{ matrix.python-version }}"
uses: "actions/setup-python@v2"
with:
python-version: "${{ matrix.python-version }}"
- name: "Install"
run: "make install"
- name: "Unit test"
run: "make utest"