Skip to content

Commit 9e2487b

Browse files
committed
update release gha to use trusted publisher
1 parent ca266dc commit 9e2487b

File tree

1 file changed

+30
-28
lines changed

1 file changed

+30
-28
lines changed

.github/workflows/release.yml

Lines changed: 30 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -10,37 +10,39 @@ concurrency:
1010
cancel-in-progress: true
1111

1212
jobs:
13-
pypi-publish:
14-
name: Upload release to PyPI
15-
runs-on: ubuntu-latest
16-
environment:
17-
name: release
18-
url: https://pypi.org/p/pdal-plugins
19-
permissions:
20-
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
21-
strategy:
22-
fail-fast: true
2313

14+
build_sdist:
15+
name: Build source distribution
16+
runs-on: ubuntu-latest
2417
steps:
2518
- uses: actions/checkout@v4
2619

27-
- name: Setup micromamba
28-
uses: conda-incubator/setup-miniconda@v3
20+
- uses: actions/setup-python@v5
21+
name: Install Python
22+
with:
23+
python-version: '3.11'
24+
25+
- name: Build sdist
26+
run: pipx run build --sdist
27+
28+
- uses: actions/upload-artifact@v4
2929
with:
30-
miniforge-variant: Miniforge3
31-
miniforge-version: latest
32-
use-mamba: true
33-
python-version: ${{ matrix.python-version }}
34-
auto-update-conda: true
35-
environment-file: .github/environment.yml
36-
37-
- name: Install dependencies
38-
shell: bash -l {0}
39-
run: |
40-
python -m pip install build pipx twine
41-
pipx run build --sdist
42-
43-
- name: Publish package distributions to PyPI
44-
if: github.event_name == 'release' && github.event.action == 'published'
45-
uses: pypa/gh-action-pypi-publish@release/v1
30+
name: cibw-sdist
31+
path: dist/*.tar.gz
32+
33+
upload_pypi:
34+
needs: [build_wheels, build_sdist]
35+
runs-on: ubuntu-latest
36+
environment: pypi
37+
permissions:
38+
id-token: write
39+
if: github.event_name == 'release' && github.event.action == 'published'
40+
steps:
41+
- uses: actions/download-artifact@v4
42+
with:
43+
pattern: cibw-*
44+
path: dist
45+
merge-multiple: true
46+
47+
- uses: pypa/gh-action-pypi-publish@release/v1
4648

0 commit comments

Comments
 (0)