Skip to content

Commit

Permalink
Use trusted publisher (#533)
Browse files Browse the repository at this point in the history
  • Loading branch information
jarrodmillman committed Mar 22, 2024
1 parent 19167fe commit aaafe13
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Build Wheel and Release
on:
push:
tags:
- v*

jobs:
pypi-publish:
name: upload release to PyPI
if: github.repository_owner == 'numpy' && startsWith(github.ref, 'refs/tags/v') && github.actor == 'jarrodmillman' && always()
runs-on: ubuntu-latest
# Specifying a GitHub environment is optional, but strongly encouraged
environment: release
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: actions/setup-python@v5
name: Install Python
with:
python-version: "3.12"

- name: Build wheels
run: |
git clean -fxd
pip install -U build twine wheel
python -m build --sdist --wheel
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

0 comments on commit aaafe13

Please sign in to comment.