Update PyPI to trusted publisher (#16709)
This commit is contained in:
parent
fe61f9d54a
commit
c17ddcdf70
2 changed files with 7 additions and 5 deletions
11
.github/workflows/publish.yml
vendored
11
.github/workflows/publish.yml
vendored
|
|
@ -17,6 +17,8 @@ jobs:
|
||||||
if: github.repository == 'ultralytics/ultralytics' && github.actor == 'glenn-jocher'
|
if: github.repository == 'ultralytics/ultralytics' && github.actor == 'glenn-jocher'
|
||||||
name: Publish
|
name: Publish
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
id-token: write # for PyPI trusted publishing
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
@ -85,12 +87,13 @@ jobs:
|
||||||
if publish:
|
if publish:
|
||||||
print('Ready to publish new version to PyPI ✅.')
|
print('Ready to publish new version to PyPI ✅.')
|
||||||
id: check_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
|
- name: Publish to PyPI
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
if: (github.event_name == 'push' || github.event.inputs.pypi == 'true') && steps.check_pypi.outputs.increment == 'True'
|
if: (github.event_name == 'push' || github.event.inputs.pypi == 'true') && steps.check_pypi.outputs.increment == 'True'
|
||||||
run: |
|
uses: pypa/gh-action-pypi-publish@release/v1
|
||||||
python -m build
|
|
||||||
python -m twine upload dist/* -u __token__ -p ${{ secrets.PYPI_TOKEN }}
|
|
||||||
- name: Publish new tag
|
- name: Publish new tag
|
||||||
if: (github.event_name == 'push' || github.event.inputs.pypi == 'true') && steps.check_pypi.outputs.increment == 'True'
|
if: (github.event_name == 'push' || github.event.inputs.pypi == 'true') && steps.check_pypi.outputs.increment == 'True'
|
||||||
run: |
|
run: |
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,6 @@ keywords = ["machine-learning", "deep-learning", "computer-vision", "ML", "DL",
|
||||||
authors = [
|
authors = [
|
||||||
{ name = "Glenn Jocher", email = "glenn.jocher@ultralytics.com" },
|
{ name = "Glenn Jocher", email = "glenn.jocher@ultralytics.com" },
|
||||||
{ name = "Jing Qiu", email = "jing.qiu@ultralytics.com" },
|
{ name = "Jing Qiu", email = "jing.qiu@ultralytics.com" },
|
||||||
{ name = "Ayush Chaurasia" },
|
|
||||||
]
|
]
|
||||||
maintainers = [
|
maintainers = [
|
||||||
{ name = "Ultralytics", email = "hello@ultralytics.com" },
|
{ name = "Ultralytics", email = "hello@ultralytics.com" },
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue