Skip to content

Commit c5a0d16

Browse files
authored
[CI] Add workflow to deploy wheel to pypi (#10)
Add a workflow to build the wheel and upload to pypi.
1 parent b6aedf9 commit c5a0d16

File tree

2 files changed

+61
-3
lines changed

2 files changed

+61
-3
lines changed
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Deploy Wheel to PyPI
2+
3+
on:
4+
release:
5+
types: [published]
6+
workflow_dispatch:
7+
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.sha }}
10+
cancel-in-progress: true
11+
12+
permissions:
13+
contents: read
14+
id-token: write # For trusted publishing to PyPI
15+
16+
jobs:
17+
build-wheel:
18+
if: github.repository == 'NVIDIA/tilus'
19+
runs-on: linux-amd64-gpu-l4-latest-1
20+
container:
21+
image: nvidia/cuda:12.6.2-devel-ubuntu22.04
22+
options: --gpus all
23+
outputs:
24+
wheel-path: ${{ steps.setup-and-install.outputs.wheel-path }}
25+
steps:
26+
- name: Checkout Repository
27+
uses: actions/checkout@v4
28+
29+
- name: Setup and Install Tilus
30+
id: setup-and-install
31+
uses: ./.github/actions/setup-environment
32+
with:
33+
python-version: '3.10'
34+
35+
- name: Upload wheel artifact
36+
uses: actions/upload-artifact@v4
37+
with:
38+
name: tilus-wheel
39+
path: dist/*.whl
40+
retention-days: 7
41+
42+
deploy-to-pypi:
43+
needs: build-wheel
44+
# Only deploy to PyPI if triggered by release (not manual workflow_dispatch)
45+
if: github.repository == 'NVIDIA/tilus' && github.event_name == 'release'
46+
runs-on: ubuntu-latest
47+
environment:
48+
name: pypi
49+
url: https://pypi.org/p/tilus
50+
steps:
51+
- name: Download wheel artifact
52+
uses: actions/download-artifact@v4
53+
with:
54+
name: tilus-wheel
55+
path: dist/
56+
57+
- name: Publish to PyPI
58+
uses: pypa/gh-action-pypi-publish@release/v1

.github/workflows/tests.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
files: |
2929
tests/**
3030
python/**
31-
sha: 'main'
31+
base_sha: 'main'
3232

3333
- name: Check for changes in examples
3434
id: changed-examples
@@ -37,7 +37,7 @@ jobs:
3737
files: |
3838
python/**
3939
examples/**
40-
sha: 'main'
40+
base_sha: 'main'
4141

4242
- name: Check for changes in docs
4343
id: changed-docs
@@ -46,7 +46,7 @@ jobs:
4646
files: |
4747
python/**
4848
docs/**
49-
sha: 'main'
49+
base_sha: 'main'
5050

5151
tests:
5252
needs: check-changes

0 commit comments

Comments
 (0)