Skip to content

Commit

Permalink
Add release action, deploy wheel to artifact registry on publish (#48)
Browse files Browse the repository at this point in the history
  • Loading branch information
sritchie authored Jan 31, 2024
1 parent f2c596c commit 6850ba6
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 2 deletions.
61 changes: 61 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Release to Artifact Registry

on:
release:
types: [published]

jobs:
release:
runs-on: ubuntu-20.04

# Add "id-token" with the intended permissions.
permissions:
contents: 'read'
id-token: 'write'

steps:
- uses: actions/checkout@v4
with:
# This is here so that the versioning plugin will be able to see tags
# and version using them.
fetch-depth: 0

- name: install packages
run: sudo apt-get install -y libegl1-mesa-dev libglu1-mesa-dev

# This is needed to build our wheel. See
# https://github.com/Jimver/cuda-toolkit/blob/master/src/links/linux-links.ts
# for available versions
- uses: Jimver/[email protected]
id: cuda-toolkit
with:
cuda: '11.8.0'
linux-local-args: '["--toolkit"]'
method: 'network'

- uses: actions/setup-python@v4
with:
python-version: 3.11.5

- id: auth
uses: google-github-actions/auth@v2
with:
credentials_json: "${{ secrets.ARTIFACT_REGISTRY_KEY }}"

- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v2

- name: Display gcloud info
run: gcloud info

- name: Install release dependencies
run: |
python -m pip install -U pip
python -m pip install cibuildwheel==2.12.0 build==0.10.0 wheel twine
python -m pip install keyrings.google-artifactregistry-auth
- name: Build the wheel and archive
run: python -m build

- name: Upload to Artifact Registry
run: python3 -m twine upload --repository-url https://us-west1-python.pkg.dev/probcomp-caliban/probcomp/ dist/*
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@ pip install keyring keyrings.google-artifactregistry-auth
Finally, install Bayes3D:

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

Download model and data assets:
Expand Down

0 comments on commit 6850ba6

Please sign in to comment.