Skip to content

Commit

Permalink
Add upload job.
Browse files Browse the repository at this point in the history
  • Loading branch information
joaander committed Jun 20, 2024
1 parent d81807c commit 2b02274
Showing 1 changed file with 25 additions and 39 deletions.
64 changes: 25 additions & 39 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,42 +34,28 @@ jobs:
- name: Build wheel
run: python3 -m build --outdir dist/ .

- run: ls -lR dist
# - uses: actions/[email protected]
# with:
# name: dist-python-${{ matrix.python.version }}-${{ matrix.os.base }}-${{ matrix.os.arch }}
# path: ./wheelhouse/*.whl

# upload_pypi:
# name: Publish [PyPI]
# needs: [build_wheel]
# runs-on: ubuntu-latest

# steps:
# - name: Download artifacts
# uses: actions/[email protected]
# with:
# merge-multiple: 'true'
# pattern: dist-*
# path: dist

# - name: Check files
# run: ls -lR dist

# - name: Upload to PyPI
# # upload to PyPI on every tag starting with 'v'
# if: startsWith(github.ref, 'refs/tags/v')
# uses: pypa/[email protected]
# with:
# user: __token__
# password: ${{ secrets.PYPI_API_TOKEN }}

# - name: Upload to TestPyPI
# # otherwise, upload to TestPyPi
# if: ${{ !startsWith(github.ref, 'refs/tags/v') && (github.event_name != 'pull_request' || (github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]')) }}
# uses: pypa/[email protected]
# with:
# user: __token__
# password: ${{ secrets.TEST_PYPI_API_TOKEN }}
# repository-url: https://test.pypi.org/legacy/
# skip-existing: true
- uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
name: dist
path: dist

upload_pypi:
name: Publish [PyPI]
needs: [build_wheel]
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- name: Download artifacts
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
with:
merge-multiple: 'true'
pattern: dist
path: dist

- name: Check files
run: ls -lR dist

- name: Upload to PyPI
if: startsWith(github.ref, 'refs/tags/v')
uses: pypa/gh-action-pypi-publish@ec4db0b4ddc65acdf4bff5fa45ac92d78b56bdf0 # v1.9.0

0 comments on commit 2b02274

Please sign in to comment.