Skip to content

Commit

Permalink
chore: Update GitHub Actions workflow to trigger on any tag starting …
Browse files Browse the repository at this point in the history
…with 'v' and fetch all history for all tags and branches
  • Loading branch information
pyrotank41 committed Aug 18, 2024
1 parent ff57264 commit 74526a6
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 10 deletions.
24 changes: 15 additions & 9 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,35 @@
name: Publish Python 🐍 distribution 📦 to PyPI

on:
release:
types: [created]
push:
tags:
- 'v*' # Trigger on any tag starting with 'v'

jobs:
build-and-publish:
name: Build and publish Python 🐍 distribution 📦 to PyPI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Fetch all history for all tags and branches

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11"

- name: Install Poetry
run: |
curl -sSL https://install.python-poetry.org | python3 -
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Install dependencies
run: poetry install
- name: Build package
run: poetry build
- name: Publish package
uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}

- name: Run publish script
env:
PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
run: |
poetry config pypi-token.pypi $PYPI_TOKEN
poetry run python publish_script.py
7 changes: 6 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ python-dotenv = "^1.0.1"
ipykernel = "^6.29.5"
poetry-dynamic-versioning = "^1.4.0"

[tool.poetry-dynamic-versioning]
enable = true
vcs = "git"
style = "semver"

[build-system]
requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning"]
requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning>=1.0.0,<2.0.0"]
build-backend = "poetry_dynamic_versioning.backend"

0 comments on commit 74526a6

Please sign in to comment.