diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 8e94cd4..dd8e9b1 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -4,6 +4,7 @@ name: main on: push: branches: [ '*', $default-branch ] + tags: 'v*' pull_request: branches: [ $default-branch ] @@ -43,13 +44,30 @@ jobs: mpirun -n 4 --oversubscribe python -m pytest --with-mpi - name: Version run: bash check_tag.sh mpsort/version.py -# - export CFLAGS="${CFLAGS} -Wall" -#deploy: -# - provider: pypi -# distributions: sdist -# user: "rainwoodman" -# password: -# secure: "cvta3oslqLseiE4bQxSk2CLeL6ZjdNyOQ660k7Y8vKXMWyjJikkG0MWEyHpDiYNXfAqcJZBnqruJ3+7XNOxQxahDSxXkiHruFASliUaEZPiLSvXZ9RrTCoz4epU6bwqHhENn2+JSyBbO4kzzp/4fttj+1bjTF4+4KDZ5UdagaccXke6cuf7T6VkuEGLqn5gfOteweQ/G0iwrqixd+w7HGjkwWSiGi3FTYjVY2B14sx0OiDx6vzLSo9IrRD7yh0DL7BWdcq+UpvnhcO2mtjYpIlgjULa7H3BqSQj2EhTQ0IaOfmK010n3bwL9NWjc6wZElEcbOLeIGx58tK0SknQiJgKvI59rnKLgVNjpSwT1V2wqD+CzHjRavR08OherMIjPg3PVJx8Q6nj3EeNJU9T6l6JFZFgFZBi+hve9NCh6gOQkIR7F2b7riIhu3oPIV+0I8EJ27hiegg1IYASyvxu1ubhuHb+Fsd5iKHE7vtxj0lkOOI6cs9fSPdnw7clPVytotvIdN+IRz/arotYf2t33zEPgEQ1j/J+ZC5mLLPsuPO7WUivABEVYxqAzZMpkakTxEtTDcvXwv8ij+lkWjQiU65Zwn/d1tBC62AxMBOW9BHAqBC7xct4CyUIHrTvv9Xt85/tvysVhBFZppEnfsfyIBM4gNhAEVy0RqAlkjpFXh0o=" -# on: -# tags : true -# condition : $TRAVIS_PYTHON_VERSION = "3.7" + - name: Store the distribution packages + if: matrix.python-version == '3.10' #Only do this once! + uses: actions/upload-artifact@v4 + with: + name: python-package-distributions + path: dist/ + + #From https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/ + publish-to-pypi: + name: Publish to PyPI + if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes + needs: + - build + runs-on: ubuntu-latest + environment: + name: pypi + url: https://pypi.org/p/mpsort + permissions: + id-token: write # IMPORTANT: mandatory for trusted publishing + steps: + - name: Download all the dists + uses: actions/download-artifact@v4 + with: + name: python-package-distributions + path: dist/ + - name: Publish distribution to PyPI + uses: pypa/gh-action-pypi-publish@release/v1