Feat: Add a new alternative to select the latest published version of… #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: Build and publish on version tag | |
on: | |
push: | |
tags: | |
- 'v[0-9]+.[0-9]+.[0-9]+' | |
env: | |
TOKEN: ${{ secrets.PYPI_TOKEN }} | |
PASSWORD: ${{ secrets.PYPI_PASSWORD }} | |
TAG_VERSION: ${{ github.ref_name }} | |
jobs: | |
build_and_publish: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.9' | |
- name: Install poetry | |
run: pip install poetry | |
- name: Build package | |
run: | | |
poetry version ${TAG_VERSION#v} | |
poetry build | |
- name: Config repository | |
run: | | |
poetry config pypi-token.pypi ${{ env.TOKEN }} | |
poetry config http-basic.pypi multi_coop "${{ env.PASSWORD }}" | |
- name: Publish ${{ env.TAG_VERSION }} | |
run: poetry publish | |
- name: Commit pyproject.toml version bump | |
uses: actions-js/push@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
message: "Automatic pyproject.toml version Bump (${{ env.TAG_VERSION }}) [skip ci]" |