Skip to content

Commit

Permalink
Update publish-pypi.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
menckend authored Oct 24, 2024
1 parent 0a87d3c commit 1fd51fd
Showing 1 changed file with 24 additions and 2 deletions.
26 changes: 24 additions & 2 deletions .github/workflows/publish-pypi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push
jobs:
build:
if: contains(github.ref, '/tags/') && contains(github.event.base_ref, 'main')
if: contains(github.ref, '/tags/') && ((contains(github.event.base_ref, 'main')) || (contains(github.event.base_ref, 'test')))
environment:
name: pypi
url: https://pypi.org/p/netbox_ptov # Replace <package-name> with your PyPI project name
Expand Down Expand Up @@ -49,7 +49,29 @@ jobs:
path: dist/
- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1


publish-to-pypi-test:
if: contains(github.ref, '/tags/') && contains(github.event.base_ref, 'test')
name: >-
Publish Python distribution of test branch to test.PyPI.org
needs:
- build
runs-on: ubuntu-latest
environment:
name: pypi
url: https://test.pypi.org/p/dcnodatg
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing
steps:
- name: Download all the dists
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
repository-url: https://test.pypi.org/legacy/


github-release:
if: contains(github.ref, '/tags/') && contains(github.event.base_ref, 'main')
Expand Down

0 comments on commit 1fd51fd

Please sign in to comment.