Skip to content

Commit

Permalink
Add action to make a release and publish to PyPI
Browse files Browse the repository at this point in the history
- The action is triggered on tag push events.
- It's needed to configure an action token named
`PYPI_TOKEN`.

Co-authored-by: Darwish Ahmad Herati <13837531+daherati@users.noreply.github.com>
Co-authored-by: mateuslatrova <57113699+mateuslatrova@users.noreply.github.com>
  • Loading branch information
3 people committed Dec 1, 2023
1 parent 6d3e42b commit 85adce3
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/release_and_publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Create and publish a release

on:
push:
tags:
- 'v*.*.*'

jobs:
create_release:
name: Create Release
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: ncipollo/release-action@v1
with:
name: Release ${{ github.ref_name }}
makeLatest: true

publish_to_pypi:
name: Publish to PyPI
needs: create_release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Build and publish to PyPI
uses: JRubics/poetry-publish@v1.17
with:
pypi_token: ${{ secrets.PYPI_TOKEN }}
ignore_dev_requirements: "yes"

0 comments on commit 85adce3

Please sign in to comment.