From 70b18354a1c3ff4bea08497e9c5df1f22751bb34 Mon Sep 17 00:00:00 2001 From: Nathan Hoos Date: Sun, 5 May 2024 23:25:10 +0000 Subject: [PATCH] fix release --- .github/workflows/CI.yml | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 9ca6137..d40b398 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -79,16 +79,32 @@ jobs: name: source-dist path: dist/*.tar.gz - release: - name: Release - needs: build-and-test + pypi-publish: + name: Upload release to PyPI runs-on: ubuntu-latest - if: startsWith(github.ref, 'refs/tags/') + environment: + name: pypi + url: https://pypi.org/project/function-sampler/ + permissions: + contents: read # Assuming you need to access the repository contents + id-token: write # IMPORTANT: this permission is mandatory for trusted publishing steps: - - uses: actions/download-artifact@v4 - - name: Publish to PyPI - uses: pypa/gh-action-pypi-publish@v1 + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v5 with: + python-version: '3.x' # Adjust to match the Python version you are using + + - name: Build package + run: | + python -m pip install --upgrade build + python -m build + + - name: Publish package distributions to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + user: __token__ password: ${{ secrets.PYPI_API_TOKEN }} - + +