Skip to content

Commit

Permalink
workflows: Add deploy job
Browse files Browse the repository at this point in the history
  • Loading branch information
avdgrinten committed Oct 28, 2024
1 parent f32f3fd commit 6dbc8be
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,28 @@ jobs:
with:
name: packages
path: dist/y4-*.tar.gz

deploy:
name: Publish release
runs-on: ubuntu-latest
if: "startsWith(github.ref, 'refs/tags/v')"
needs: build
steps:
- name: Fetch artifact
uses: actions/download-artifact@v4
with:
name: packages
path: artifact
- name: Prepare dist/ directory
run: |
mkdir dist/
# Get exactly the version that we want to publish.
version="$(grep -Po '(?<=^refs/tags/v).+$' <<< "$ref")"
mv "artifact/y4-$version.tar.gz" dist/
env:
ref: ${{ github.ref }}
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}

0 comments on commit 6dbc8be

Please sign in to comment.