Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to trusted publisher releases #980

Open
henryiii opened this issue Apr 2, 2024 · 0 comments
Open

Update to trusted publisher releases #980

henryiii opened this issue Apr 2, 2024 · 0 comments

Comments

@henryiii
Copy link
Member

henryiii commented Apr 2, 2024

All stored secreted were cleared by the Scikit-HEP team due to a security threat that turned out to be a GitHub bug. It is recommended that Scikit-HEP projects move to trusted publisher releases instead of regenerating tokens. This requires telling PyPI about the GitHub details (repo location, ci job file, and environment), and setting up something like this (taken from https://learn.scientific-python.org/development/guides/gha-wheels/#publishing):

upload_all:
  needs: [build_wheels, make_sdist]
  environment: pypi
  permissions:
    id-token: write
  runs-on: ubuntu-latest
  if: github.event_name == 'release' && github.event.action == 'published'
  steps:
    - uses: actions/download-artifact@v4
      with:
        pattern: cibw-*
        path: dist
        merge-multiple: true

    - uses: pypa/gh-action-pypi-publish@release/v1

I'm not sure how this interacts with branch-based releases that are currently used. I think you might be able to just remove the "environment" field (and leave the field blank on PyPI) and it might just work (though be less secure and have fewer options for release approvals and such that GitHub environments provide).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant