This repository has been archived by the owner on Jul 5, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 203
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
1 parent
46caed8
commit 6c1e1b6
Showing
1 changed file
with
38 additions
and
23 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,32 +1,47 @@ | ||
name: Publish to PyPI | ||
name: Publish To PyPi | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
description: 'version' | ||
required: true | ||
push: | ||
tags: | ||
- '*.*.*' | ||
|
||
jobs: | ||
pypi: | ||
if: ${{ inputs.pip}} | ||
release: | ||
name: Release | ||
runs-on: ubuntu-latest | ||
name: create pypi | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
ref: ${{inputs.version}} | ||
- name: Set up Python 3.11.4 | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Python 3.10 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.11.4' | ||
python-version: "3.10" | ||
|
||
- name: Install Poetry | ||
uses: snok/install-poetry@v1 | ||
- name: Build | ||
run: | | ||
curl -sSL https://install.python-poetry.org | python - -y | ||
- name: Update PATH | ||
run: echo "$HOME/.local/bin" >> $GITHUB_PATH | ||
|
||
- name: Build project for distribution | ||
run: poetry build | ||
- name: Push to pypi | ||
env: | ||
PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }} | ||
|
||
- name: Check Version | ||
id: check-version | ||
run: | | ||
poetry config pypi-token.pypi $PYPI_TOKEN | ||
poetry publish | ||
[[ "$(poetry version --short)" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] || echo prerelease=true >> $GITHUB_OUTPUT | ||
- name: Create Release | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
artifacts: "dist/*" | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
draft: false | ||
prerelease: steps.check-version.outputs.prerelease == 'true' | ||
|
||
- name: Publish to PyPI | ||
env: | ||
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }} | ||
run: poetry publish |