Skip to content
Merged
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
53 changes: 31 additions & 22 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,25 +76,34 @@ jobs:
path: dist/*.tar.gz

# TODO: Discuss release workflow
# upload_pypi:
# name: Upload to PyPI
# needs: [build_wheels, build_sdist]
# runs-on: ubuntu-latest
# steps:
# - uses: actions/download-artifact@v4
# with:
# name: artifact
# path: dist

# - name: Publish distribution 📦 to Test PyPI
# uses: pypa/gh-action-pypi-publish@release/v1
# with:
# password: ${{ secrets.TEST_PYPI_API_TOKEN }}
# repository-url: https://test.pypi.org/legacy/
# skip-existing: true

# - name: Publish distribution 📦 to PyPI
# if: startsWith(github.ref, 'refs/tags/v')
# uses: pypa/gh-action-pypi-publish@release/v1
# with:
# password: ${{ secrets.PYPI_API_TOKEN }}
release:
name: Release
environment:
name: release
url: https://pypi.org/p/onnxoptimizer
runs-on: ubuntu-latest
permissions:
id-token: write

if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
needs: [build_wheels, build_sdist]
steps:
- uses: actions/download-artifact@v4
with:
name: artifact
path: dist

# TODO: get acccess for test.pypi
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

personal memo: waiting to get access in this issue #185

# - name: Publish distribution 📦 to Test PyPI
# uses: pypa/gh-action-pypi-publish@release/v1
# with:
# repository-url: https://test.pypi.org/legacy/
# skip-existing: true
# attestations: true

- name: Publish distribution 📦 to PyPI
if: startsWith(github.ref, 'refs/tags/v')
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://upload.pypi.org/legacy/
attestations: true
Loading