Skip to content

Commit 12d396b

Browse files
Fixed release workflow (#988)
Previous one failed https://github.com/dask/dask-ml/actions/runs/8516080288 Trying out the trusted publisher thing.
1 parent d7727ea commit 12d396b

File tree

1 file changed

+26
-18
lines changed

1 file changed

+26
-18
lines changed

.github/workflows/release.yaml

Lines changed: 26 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,36 @@ on:
55
types:
66
- created
77

8+
permissions:
9+
contents: read
10+
811
jobs:
9-
release:
10-
name: release
12+
check-package:
13+
name: Build & inspect our package.
1114
runs-on: ubuntu-latest
1215
if: ${{ github.repository }} == 'dask/dask-ml'
1316
steps:
14-
- uses: actions/checkout@v2
15-
16-
- name: Set up Python 3.x
17-
uses: actions/setup-python@v2
17+
- uses: actions/checkout@v4
1818
with:
19-
python-version: "3.x"
19+
fetch-depth: 0
20+
- uses: hynek/build-and-inspect-python-package@v2
2021

21-
- name: Install release dependencies
22-
run: |
23-
python -m pip install --upgrade pip
24-
pip install setuptools wheel twine
22+
release-pypi:
23+
permissions:
24+
id-token: write
25+
contents: read
26+
name: Publish released package to pypi.org
27+
environment: release-pypi
28+
if: github.event.action == 'published'
29+
runs-on: ubuntu-latest
30+
needs: build-package
31+
32+
steps:
33+
- name: Download packages built by build-and-inspect-python-package
34+
uses: actions/download-artifact@v4
35+
with:
36+
name: Packages
37+
path: dist
2538

26-
- name: Build and publish package
27-
env:
28-
TWINE_USERNAME: "__token__"
29-
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
30-
run: |
31-
python setup.py sdist bdist_wheel
32-
twine upload dist/*
39+
- name: Upload package to PyPI
40+
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)