Skip to content

Commit

Permalink
Update setup-python version, add publish workflow
Browse files Browse the repository at this point in the history
- Update setup-python version from v3 to v5 in linting workflow
- Add new publish workflow for PyPI with necessary steps
  • Loading branch information
isFakeAccount committed Apr 1, 2024
1 parent cae81ed commit 4ff1313
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/linting.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:

steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v3
- uses: actions/setup-python@v5

- name: Install Poetry
run: pipx install poetry
Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Publish to PyPI
on:
push:
tags:
- '*'

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5

- name: Install Poetry
run: pipx install poetry

- name: Get Tag Name
id: get_and_remove_v_from_tag
run: |
TAG_NAME="${{ github.ref_name }}"
TAG_NAME="${TAG_NAME:1}" # Remove the first character (leading 'v')
echo "VERSION=${TAG_NAME}" >> $GITHUB_ENV
- name: Build & Upload
env:
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
run: |
poetry config pypi-token.pypi $PYPI_TOKEN
poetry version $VERSION
poetry build
poetry publish

0 comments on commit 4ff1313

Please sign in to comment.