Skip to content

Commit 6850ba6

Browse files
authored
Add release action, deploy wheel to artifact registry on publish (#48)
1 parent f2c596c commit 6850ba6

File tree

2 files changed

+62
-2
lines changed

2 files changed

+62
-2
lines changed

.github/workflows/release.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Release to Artifact Registry
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
release:
9+
runs-on: ubuntu-20.04
10+
11+
# Add "id-token" with the intended permissions.
12+
permissions:
13+
contents: 'read'
14+
id-token: 'write'
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
with:
19+
# This is here so that the versioning plugin will be able to see tags
20+
# and version using them.
21+
fetch-depth: 0
22+
23+
- name: install packages
24+
run: sudo apt-get install -y libegl1-mesa-dev libglu1-mesa-dev
25+
26+
# This is needed to build our wheel. See
27+
# https://github.com/Jimver/cuda-toolkit/blob/master/src/links/linux-links.ts
28+
# for available versions
29+
- uses: Jimver/[email protected]
30+
id: cuda-toolkit
31+
with:
32+
cuda: '11.8.0'
33+
linux-local-args: '["--toolkit"]'
34+
method: 'network'
35+
36+
- uses: actions/setup-python@v4
37+
with:
38+
python-version: 3.11.5
39+
40+
- id: auth
41+
uses: google-github-actions/auth@v2
42+
with:
43+
credentials_json: "${{ secrets.ARTIFACT_REGISTRY_KEY }}"
44+
45+
- name: Set up Cloud SDK
46+
uses: google-github-actions/setup-gcloud@v2
47+
48+
- name: Display gcloud info
49+
run: gcloud info
50+
51+
- name: Install release dependencies
52+
run: |
53+
python -m pip install -U pip
54+
python -m pip install cibuildwheel==2.12.0 build==0.10.0 wheel twine
55+
python -m pip install keyrings.google-artifactregistry-auth
56+
57+
- name: Build the wheel and archive
58+
run: python -m build
59+
60+
- name: Upload to Artifact Registry
61+
run: python3 -m twine upload --repository-url https://us-west1-python.pkg.dev/probcomp-caliban/probcomp/ dist/*

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,7 @@ pip install keyring keyrings.google-artifactregistry-auth
4848
Finally, install Bayes3D:
4949

5050
```bash
51-
pip install --extra-index-url https://us-west1-python.pkg.dev/probcomp-caliban/probcomp/simple/ \
52-
git+https://github.com/probcomp/bayes3d.git#egg=bayes3d
51+
pip install bayes3d --extra-index-url https://us-west1-python.pkg.dev/probcomp-caliban/probcomp/simple/
5352
```
5453

5554
Download model and data assets:

0 commit comments

Comments
 (0)