-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: adds action to publish to pypi on tag
- Loading branch information
Showing
1 changed file
with
58 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,58 @@ | ||
name: publish-pypi | ||
run-name: Test, build and publish to pypi by @${{ github.actor }} | ||
on: | ||
push: | ||
tags: | ||
- "v*.*.*" # Trigger the workflow only on version tags | ||
jobs: | ||
# test: | ||
# runs-on: ubuntu-latest | ||
|
||
# steps: | ||
# - name: Checkout | ||
# uses: actions/checkout@v4 | ||
# - name: Setup Python | ||
# uses: actions/setup-python@v5 | ||
# with: | ||
# python-version-file: pyproject.toml | ||
# - name: Install Task | ||
# uses: arduino/setup-task@v2 | ||
# with: | ||
# version: 3.x | ||
# repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
# - name: Install dependencies | ||
# run: | | ||
# pip install poetry | ||
# poetry install | ||
# - name: Run tests | ||
# run: | | ||
# export GACC_API_KEY=${{ secrets.GACC_API_KEY }} | ||
# task test | ||
build-and-publish: | ||
runs-on: ubuntu-latest | ||
# needs: test | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Setup Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version-file: pyproject.toml | ||
- name: Install Task | ||
uses: arduino/setup-task@v2 | ||
with: | ||
version: 3.x | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Install dependencies | ||
run: | | ||
pip install poetry | ||
poetry install | ||
- name: Build package | ||
run: | | ||
poetry build | ||
- name: Publish package | ||
env: | ||
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_API_KEY }} | ||
run: | | ||
poetry publish --no-interaction --username __token__ --password $POETRY_PYPI_TOKEN_PYPI |