Skip to content

Commit aaafe13

Browse files
Use trusted publisher (#533)
1 parent 19167fe commit aaafe13

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

.github/workflows/release.yml

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Build Wheel and Release
2+
on:
3+
push:
4+
tags:
5+
- v*
6+
7+
jobs:
8+
pypi-publish:
9+
name: upload release to PyPI
10+
if: github.repository_owner == 'numpy' && startsWith(github.ref, 'refs/tags/v') && github.actor == 'jarrodmillman' && always()
11+
runs-on: ubuntu-latest
12+
# Specifying a GitHub environment is optional, but strongly encouraged
13+
environment: release
14+
permissions:
15+
# IMPORTANT: this permission is mandatory for trusted publishing
16+
id-token: write
17+
steps:
18+
- uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0
21+
22+
- uses: actions/setup-python@v5
23+
name: Install Python
24+
with:
25+
python-version: "3.12"
26+
27+
- name: Build wheels
28+
run: |
29+
git clean -fxd
30+
pip install -U build twine wheel
31+
python -m build --sdist --wheel
32+
33+
- name: Publish package distributions to PyPI
34+
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)