From 42c23caa8226a4e834598d50b2d148aedf54bf0d Mon Sep 17 00:00:00 2001 From: Nathan Hoos Date: Sun, 5 May 2024 23:30:04 +0000 Subject: [PATCH] fix release --- .github/workflows/CI.yml | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index d40b398..d988aaf 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -82,29 +82,36 @@ jobs: pypi-publish: name: Upload release to PyPI runs-on: ubuntu-latest + needs: [build-and-test, sdist] # Ensure this job waits for others to finish 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 + contents: read + id-token: write steps: - uses: actions/checkout@v4 - - name: Set up Python - uses: actions/setup-python@v5 + - uses: actions/setup-python@v5 + with: + python-version: '3.10' # Match the version used in building + + - name: Download all artifacts + uses: actions/download-artifact@v4 with: - python-version: '3.x' # Adjust to match the Python version you are using + path: dist - - name: Build package + - name: Install Twine run: | - python -m pip install --upgrade build - python -m build + python -m pip install --upgrade pip + pip install twine - name: Publish package distributions to PyPI - uses: pypa/gh-action-pypi-publish@release/v1 - with: - user: __token__ - password: ${{ secrets.PYPI_API_TOKEN }} + run: | + twine upload dist/* + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} +