From 67ac5c6dee1b73d19b3b4a6259bb67179cace8fc Mon Sep 17 00:00:00 2001 From: melkor Date: Mon, 22 Jul 2024 11:04:09 -0700 Subject: [PATCH] Upload prepublished releases to test.pypi --- .github/workflows/release.yml | 47 +++++++++++++++++++++++++++++------ 1 file changed, 40 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d68e6cc..4295b60 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,11 +1,7 @@ name: Python on: - push: - branches: - - main - - ci-test - tags: - - 'v[0-9]+.[0-9]+.[0-9]+' + release: + types: [prereleased] jobs: macos: runs-on: macos-latest @@ -23,7 +19,7 @@ jobs: uses: PyO3/maturin-action@v1 with: target: universal2-apple-darwin - args: --release --out dist + args: --release --out dist --sdist - name: Install wheels run: | pip install dist/peppi_py-*.whl --force-reinstall @@ -33,6 +29,12 @@ jobs: with: name: wheels-${{ github.job }}-${{ matrix.target }} path: dist + - name: Upload release assets + uses: skx/github-action-publish-binaries@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + args: dist/* windows: runs-on: windows-latest strategy: @@ -61,6 +63,12 @@ jobs: with: name: wheels-${{ github.job }}-${{ matrix.target }} path: dist + - name: Upload release assets + uses: skx/github-action-publish-binaries@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + args: dist/* linux: runs-on: ubuntu-latest strategy: @@ -121,3 +129,28 @@ jobs: with: name: wheels-${{ github.job }}-${{ matrix.target }} path: dist + - name: Upload release assets + uses: skx/github-action-publish-binaries@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + args: dist/* + release: + name: Release + runs-on: ubuntu-latest + needs: [macos, windows, linux, linux-cross] + steps: + - uses: actions/download-artifact@v4 + with: + pattern: wheels-* + merge-multiple: true + - uses: actions/setup-python@v5 + with: + python-version: 3.12 + - name: Publish to PyPI + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.TEST_PYPI_TOKEN }} + run: | + pip install --upgrade twine + twine upload --repository testpypi --skip-existing *