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 a9bc70a commit 04590ae
Showing 1 changed file with 7 additions and 16 deletions.
23 changes: 7 additions & 16 deletions .github/workflows/publish-pypi.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
name: Publish Release package to Pypi.org
name: Publish releases on main to PyPi.org

on:
release:
types: [published]
branches: main

push
jobs:
build:
if: ${{ startsWith(github.ref, 'refs/tags/') }} # only publish to test.pypi.org on non-tagged commits
if: contains(github.ref, '/tags/') && contains(github.event.base_ref, 'main')
environment:
name: pypi
url: https://pypi.org/p/netbox_ptov # Replace <package-name> with your PyPI project name
Expand All @@ -33,7 +30,7 @@ jobs:
name: python-package-distributions
path: dist/
publish-to-pypi:
if: ${{ startsWith(github.ref, 'refs/tags/') }} # only publish to pypi.org on tagged commits from main branch
if: contains(github.ref, '/tags/') && contains(github.event.base_ref, 'main')
name: >-
Publish Python distribution to PyPI
needs:
Expand All @@ -52,8 +49,10 @@ jobs:
path: dist/
- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1


github-release:
if: ${{ startsWith(github.ref, 'refs/tags/') }} # only publish to pypi.org on tagged commits from main branch
if: contains(github.ref, '/tags/') && contains(github.event.base_ref, 'main')
environment:
name: pypi
url: https://pypi.org/p/netbox_ptov # Replace <package-name> with your PyPI project name
Expand All @@ -78,14 +77,6 @@ jobs:
inputs: >-
./dist/*.tar.gz
./dist/*.whl
- name: Create GitHub Release
env:
GITHUB_TOKEN: ${{ github.token }}
run: >-
gh release create
'${{ github.ref_name }}'
--repo '${{ github.repository }}'
--notes ""
- name: Upload artifact signatures to GitHub Release
env:
GITHUB_TOKEN: ${{ github.token }}
Expand Down

0 comments on commit 04590ae

Please sign in to comment.