Skip to content

Commit 7318d60

Browse files
authored
workflows: trusted publishing to PyPI (#182)
This replaces the current publishing workflow with one that doesn't require a manual API token. It also adds codesigning via Sigstore. Signed-off-by: William Woodruff <[email protected]>
1 parent 0faac19 commit 7318d60

File tree

2 files changed

+55
-31
lines changed

2 files changed

+55
-31
lines changed

.github/workflows/pythonpublish.yml

Lines changed: 0 additions & 31 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Publish to PyPI
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
build-release:
9+
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v3
14+
15+
- name: Set up Python
16+
uses: actions/setup-python@v4
17+
with:
18+
python-version: '3.x'
19+
20+
- name: Build distributions
21+
run: |
22+
python -m pip install --upgrade pip
23+
python -m pip install build
24+
python -m build
25+
26+
- name: Upload distributions
27+
uses: actions/upload-artifact@v3
28+
with:
29+
name: solc-select-dists
30+
path: dist/
31+
32+
publish:
33+
runs-on: ubuntu-latest
34+
environment: release
35+
permissions:
36+
id-token: write # For trusted publishing + codesigning.
37+
contents: write # For attaching signing artifacts to the release.
38+
needs:
39+
- build-release
40+
steps:
41+
- name: fetch dists
42+
uses: actions/download-artifact@v3
43+
with:
44+
name: solc-select-dists
45+
path: dist/
46+
47+
- name: publish
48+
uses: pypa/[email protected]
49+
50+
- name: sign
51+
uses: sigstore/[email protected]
52+
with:
53+
inputs: ./dist/*.tar.gz ./dist/*.whl
54+
release-signing-artifacts: true
55+
bundle-only: true

0 commit comments

Comments
 (0)