v0.2.8 #13
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: Publish to PyPI | |
on: | |
release: | |
types: [published] | |
jobs: | |
pypi_release: | |
runs-on: ubuntu-latest | |
environment: | |
name: pypi | |
url: https://pypi.org/p/logdetective | |
permissions: | |
id-token: write | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v2 | |
# Regex by https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string | |
- name: Check semver | |
run: > | |
echo "${{ github.ref }}" | grep -q -P "^refs/tags/v(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$" | |
|| exit 1 | |
- name: Install Poetry | |
run: curl -sSL https://install.python-poetry.org | python - | |
- name: Add Poetry to path | |
run: echo "${HOME}/.poetry/bin" >> $GITHUB_PATH | |
- run: poetry install | |
- name: Build package | |
run: poetry build | |
- name: Publish package distributions to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 |