Skip to content

Commit

Permalink
Update PyPI to trusted publisher (ultralytics#16709)
Browse files Browse the repository at this point in the history
  • Loading branch information
glenn-jocher authored Oct 5, 2024
1 parent fe61f9d commit c17ddcd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ jobs:
if: github.repository == 'ultralytics/ultralytics' && github.actor == 'glenn-jocher'
name: Publish
runs-on: ubuntu-latest
permissions:
id-token: write # for PyPI trusted publishing
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand Down Expand Up @@ -85,12 +87,13 @@ jobs:
if publish:
print('Ready to publish new version to PyPI ✅.')
id: check_pypi
- name: Build package
if: (github.event_name == 'push' || github.event.inputs.pypi == 'true') && steps.check_pypi.outputs.increment == 'True'
run: python -m build
- name: Publish to PyPI
continue-on-error: true
if: (github.event_name == 'push' || github.event.inputs.pypi == 'true') && steps.check_pypi.outputs.increment == 'True'
run: |
python -m build
python -m twine upload dist/* -u __token__ -p ${{ secrets.PYPI_TOKEN }}
if: (github.event_name == 'push' || github.event.inputs.pypi == 'true') && steps.check_pypi.outputs.increment == 'True'
uses: pypa/gh-action-pypi-publish@release/v1
- name: Publish new tag
if: (github.event_name == 'push' || github.event.inputs.pypi == 'true') && steps.check_pypi.outputs.increment == 'True'
run: |
Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ keywords = ["machine-learning", "deep-learning", "computer-vision", "ML", "DL",
authors = [
{ name = "Glenn Jocher", email = "[email protected]" },
{ name = "Jing Qiu", email = "[email protected]" },
{ name = "Ayush Chaurasia" },
]
maintainers = [
{ name = "Ultralytics", email = "[email protected]" },
Expand Down

0 comments on commit c17ddcd

Please sign in to comment.