From 12d396b67150f1363b822709aed27da72630aa7c Mon Sep 17 00:00:00 2001 From: Tom Augspurger Date: Mon, 1 Apr 2024 20:47:12 -0500 Subject: [PATCH] Fixed release workflow (#988) Previous one failed https://github.com/dask/dask-ml/actions/runs/8516080288 Trying out the trusted publisher thing. --- .github/workflows/release.yaml | 44 ++++++++++++++++++++-------------- 1 file changed, 26 insertions(+), 18 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 371a33bb1..1a1722c12 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -5,28 +5,36 @@ on: types: - created +permissions: + contents: read + jobs: - release: - name: release + check-package: + name: Build & inspect our package. runs-on: ubuntu-latest if: ${{ github.repository }} == 'dask/dask-ml' steps: - - uses: actions/checkout@v2 - - - name: Set up Python 3.x - uses: actions/setup-python@v2 + - uses: actions/checkout@v4 with: - python-version: "3.x" + fetch-depth: 0 + - uses: hynek/build-and-inspect-python-package@v2 - - name: Install release dependencies - run: | - python -m pip install --upgrade pip - pip install setuptools wheel twine + release-pypi: + permissions: + id-token: write + contents: read + name: Publish released package to pypi.org + environment: release-pypi + if: github.event.action == 'published' + runs-on: ubuntu-latest + needs: build-package + + steps: + - name: Download packages built by build-and-inspect-python-package + uses: actions/download-artifact@v4 + with: + name: Packages + path: dist - - name: Build and publish package - env: - TWINE_USERNAME: "__token__" - TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }} - run: | - python setup.py sdist bdist_wheel - twine upload dist/* \ No newline at end of file + - name: Upload package to PyPI + uses: pypa/gh-action-pypi-publish@release/v1