Release #19
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: | |
release: | |
types: [published] | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v3 | |
- name: Check if tag matches pyproject.toml version | |
shell: bash | |
run: | | |
version=$(head pyproject.toml | grep "version = " | cut -d "=" -f 2 | sed "s/ // ; s/\"//g") | |
if [ "v$version" != "${{ github.ref_name }}" ]; then | |
echo "Git tag doesn't match pyproject.toml version: ${{ github.ref_name }} != v$version " | |
exit 1 | |
fi | |
exit 0 | |
continue-on-error: false | |
- name: Set Up Python | |
uses: actions/setup-python@v4 | |
id: setup-python | |
with: | |
python-version: "3.11" | |
- name: Load cached Poetry installation | |
id: cached-poetry | |
uses: actions/cache@v3 | |
with: | |
path: ~/.local | |
key: poetry-3.11-0 # increment to reset cache | |
- name: Install Poetry | |
uses: snok/install-poetry@v1 | |
with: | |
version: 1.7.0 | |
virtualenvs-create: true | |
virtualenvs-in-project: true | |
installer-parallel: true | |
- name: Show Poetry version | |
run: poetry --version | |
- name: Build and publish | |
run: | | |
poetry build --no-interaction | |
poetry publish -u __token__ -p ${{ secrets.POETRY_PYPI_TOKEN }} --no-interaction --skip-existing |