Skip to content

Commit

Permalink
Update pypi.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
pfebrer authored Jul 24, 2024
1 parent 14b1ea4 commit 9a9d5b1
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions .github/workflows/pypi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,11 @@ jobs:
upload_testpypi:
needs: [build_sdist, build_wheels]
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
environment:
name: testpypi
url: https://test.pypi.org/p/graph2mat
permissions:
id-token: write
name: Publish package to TestPyPI
runs-on: ubuntu-latest
steps:
Expand All @@ -99,10 +104,8 @@ jobs:

- uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.TESTPYPI_TOKEN }}
repository-url: https://test.pypi.org/legacy/

repository-url: https://test.pypi.org/legacy

# Check that the testpypi installation works
test_testpypi:
needs: [upload_testpypi]
Expand All @@ -127,22 +130,27 @@ jobs:
python-version: "3.8"

# We should also wait for index to update on remote server
- name: Install e3nn_matrix + dependencies
- name: Install graph2mat + dependencies
run: |
sleep 10
version=${GITHUB_REF#refs/*/v}
version=${version#refs/*/}
python -m pip install --progress-bar=off --find-links dist --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ e3nn_matrix[test]==${version}
python -m pip install --progress-bar=off --find-links dist --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ graph2mat[test]==${version}
- name: Test the installation
run: |
pytest --pyargs e3nn_matrix
pytest --pyargs graph2mat
# Upload to PyPI on every tag
upload_pypi:
needs: [test_testpypi]
name: Publish package to Pypi
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/graph2mat
permissions:
id-token: write
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
# alternatively, to publish when a GitHub Release is created, use the following rule:
# if: github.event_name == 'release' && github.event.action == 'published'
Expand All @@ -153,6 +161,3 @@ jobs:
path: dist

- uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}

0 comments on commit 9a9d5b1

Please sign in to comment.