Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .github/workflows/publish-to-pypi.yml
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you will need to specify a deployment environment in order to publish to non-test PyPI.

https://dev.azure.com/ni/DevCentral/_wiki/wikis/AppCentral.wiki/138308/How-to-Publish-to-PyPI-From-GitHub (internal link) has instructions on how to set this up.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI, some security recommendations:

  • Pin actions to specific commit hashes (or at least release tags), not branches like master.
  • Pin/lock Python packages to specific versions.
  • Split build and publish into separate jobs, using upload-artifact to pass dist/* between them.
  • In Settings >> Actions >> General, set Workflow Permissions to Read repository contents and packages permissions, and only grant permissions: id-token: write to the publish job.

Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,9 @@ jobs:
- name: Publish distribution to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.test_pypi_password }}
repository-url: https://test.pypi.org/legacy/
continue-on-error: true

- name: Publish distribution to PyPI
if: github.event.action == 'published'
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.pypi_password }}