Skip to content

Commit 1edf205

Browse files
Merge pull request #79 from graphcore-research/pypi
first draft of pypi action
2 parents bcc3d5e + 7926326 commit 1edf205

File tree

1 file changed

+58
-0
lines changed

1 file changed

+58
-0
lines changed

.github/workflows/publish.yaml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Based on template at https://docs.github.com/en/enterprise-cloud@latest/actions/use-cases-and-examples/building-and-testing/building-and-testing-python?learn=continuous_integration#publishing-to-pypi
2+
3+
name: Publish to PyPI
4+
5+
on:
6+
release:
7+
types: [published]
8+
workflow_dispatch:
9+
10+
permissions:
11+
contents: read
12+
13+
jobs:
14+
release-build:
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- uses: actions/setup-python@v5
21+
with:
22+
python-version: "3.x"
23+
24+
- name: Build release distributions
25+
run: |
26+
python -m pip install build
27+
python -m build
28+
29+
- name: Upload distributions
30+
uses: actions/upload-artifact@v4
31+
with:
32+
name: release-dists
33+
path: dist/
34+
35+
pypi-publish:
36+
runs-on: ubuntu-latest
37+
38+
needs:
39+
- release-build
40+
41+
permissions:
42+
# IMPORTANT: this permission is mandatory for trusted publishing
43+
id-token: write
44+
45+
# Dedicated environments with protections for publishing are strongly recommended.
46+
environment:
47+
name: pypi
48+
url: https://pypi.org/p/unit-scaling
49+
50+
steps:
51+
- name: Retrieve release distributions
52+
uses: actions/download-artifact@v4
53+
with:
54+
name: release-dists
55+
path: dist/
56+
57+
- name: Publish release distributions to PyPI
58+
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)