-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
41 additions
and
10 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,53 @@ | ||
name: Python CD | ||
|
||
branding: | ||
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: Publish PyPi package | ||
uses: code-specialist/pypi-poetry-publish@v1 # https://github.com/marketplace/actions/pypi-poetry-publish | ||
- name: Checkout Repository | ||
uses: actions/checkout@v3 | ||
with: | ||
BRANCH: main | ||
PYTHON_VERSION: "3.10" | ||
POETRY_VERSION: 1.7.1 | ||
POETRY_CORE_VERSION: 1.8.1 | ||
ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
PUBLISH_REGISTRY_PASSWORD: ${{ secrets.PYPI_TOKEN }} | ||
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 |
This file was deleted.
Oops, something went wrong.
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