-
Notifications
You must be signed in to change notification settings - Fork 251
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
workflows: add trusted publishing release workflow (#231)
* workflows: add trusted publishing release workflow Signed-off-by: William Woodruff <william@trailofbits.com> * release: install build dependencies Signed-off-by: William Woodruff <william@trailofbits.com> * Update .github/workflows/release.yml Co-authored-by: Alex Gaynor <alex.gaynor@gmail.com> * release: allow workflow_dispatch Signed-off-by: William Woodruff <william@trailofbits.com> * release: use pypa/build for building Signed-off-by: William Woodruff <william@trailofbits.com> * Makefile: use pypa/build Signed-off-by: William Woodruff <william@trailofbits.com> * setup: remove `setup.py publish` subcommand Invoking `setup.py` directly is discouraged, and the behavior in this hacked subcommand is covered by the Makefile. Signed-off-by: William Woodruff <william@trailofbits.com> * release: drop `--upgrade` Signed-off-by: William Woodruff <william@trailofbits.com> * release: only install build Signed-off-by: William Woodruff <william@trailofbits.com> --------- Signed-off-by: William Woodruff <william@trailofbits.com> Co-authored-by: Alex Gaynor <alex.gaynor@gmail.com>
- Loading branch information
Showing
3 changed files
with
79 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
on: | ||
workflow_dispatch: | ||
push: | ||
tags: | ||
- "*.*.*" | ||
|
||
name: release | ||
|
||
jobs: | ||
build: | ||
name: Build distributions for PyPI | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0 | ||
|
||
- name: Install build dependencies | ||
run: python -m pip install build | ||
|
||
- name: Build distributions | ||
run: python -m build | ||
|
||
- name: Upload distributions | ||
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 | ||
with: | ||
name: certifi-dists | ||
path: dist/ | ||
|
||
pypi: | ||
name: Publish to PyPI | ||
runs-on: ubuntu-latest | ||
environment: release | ||
|
||
needs: | ||
- build | ||
|
||
permissions: | ||
# Used to authenticate to PyPI via OIDC. | ||
id-token: write | ||
|
||
steps: | ||
- name: fetch dists | ||
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2 | ||
with: | ||
name: certifi-dists | ||
path: dist/ | ||
|
||
- name: publish | ||
if: github.event_name == 'push' | ||
uses: pypa/gh-action-pypi-publish@f8c70e705ffc13c3b4d1221169b84f12a75d6ca8 # v1.8.8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters