0.2.2 #3
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: Python CD | ||
branding: | ||
Check failure on line 3 in .github/workflows/python_cd.yaml GitHub Actions / Python CDInvalid workflow file
|
||
icon: "package" | ||
color: "blue" | ||
on: | ||
release: | ||
types: [ published ] | ||
inputs: | ||
BRANCH: | ||
description: "Branch to publish from" | ||
required: false | ||
default: "main" | ||
POETRY_VERSION: | ||
description: "The version of Poetry to use" | ||
required: false | ||
default: "1.7.1" | ||
POETRY_CORE_VERSION: | ||
description: "The version of Poetry Core to use" | ||
required: false | ||
default: "1.8.1" | ||
PUBLISH_REGISTRY: | ||
description: "The registry to publish to" | ||
required: false | ||
default: "https://upload.pypi.org/legacy/" | ||
jobs: | ||
publish-pypi-package: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ inputs.BRANCH }} | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Verify the tag version in the pyproject.toml | ||
run: grep -q "version = \"${{ github.event.release.tag_name }}\"" pyproject.toml || exit 1 | ||
shell: bash | ||
- name: Install poetry | ||
run: pip install poetry${{ inputs.POETRY_VERSION != '' && format('=={0}', inputs.POETRY_VERSION) || '' }} poetry-core${{ inputs.POETRY_CORE_VERSION != '' && format('=={0}', inputs.POETRY_CORE_VERSION) || '' }} | ||
shell: bash | ||
- name: Install dependencies | ||
run: poetry install --no-root | ||
shell: bash | ||
- name: Build and Publish | ||
run: | | ||
poetry config repositories.publish ${{ inputs.PUBLISH_REGISTRY }} | ||
poetry publish -p ${{ secrets.PYPI_TOKEN }} -u "__token__" -r publish --build | ||
shell: bash |