Skip to content

Release version 2024.11.006 #196

Release version 2024.11.006

Release version 2024.11.006 #196

Workflow file for this run

name: Release to Artifact Registry
on:
workflow_dispatch:
push:
branches:
- main
tags:
- 'v*.*.*'
release:
types: [published]
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: 'write'
id-token: 'write'
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- 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: Install dependencies with Yarn
run: yarn install --frozen-lockfile --production=false
- name: build the javascript bundle
run: yarn build
- name: Install and configure Poetry
uses: snok/install-poetry@v1
- name: Configure deploy keys
run: |
poetry self add keyrings.google-artifactregistry-auth
poetry config repositories.gcp https://us-west1-python.pkg.dev/probcomp-caliban/probcomp/
- name: Install deps
run: poetry install
- name: Check if triggered by push to main
id: check_trigger
run: |
if [[ "${{ github.event_name }}" == "push" && "${{ github.ref }}" == "refs/heads/main" ]]; then
echo "DEV_CHANNEL=true" >> $GITHUB_OUTPUT
else
echo "DEV_CHANNEL=false" >> $GITHUB_OUTPUT
fi
- name: Get current date and time
if: steps.check_trigger.outputs.DEV_CHANNEL == 'true'
id: datetime
run: |
echo "NEXT_VERSION=$(date +'%Y.%m.%d.%H%M.dev')" >> $GITHUB_ENV
- name: Update version in pyproject.toml
if: steps.check_trigger.outputs.DEV_CHANNEL == 'true'
run: |
poetry version ${{ env.NEXT_VERSION }}
- name: Update version query params in widget.py
run: |
VERSION=$(poetry version -s)
python scripts/update_asset_versions.py $VERSION
- name: Deploy to Artifact Registry
run: poetry publish --build --repository gcp
- name: Create GitHub Release
if: steps.check_trigger.outputs.DEV_CHANNEL == 'false'
uses: softprops/action-gh-release@v1
with:
body_path: docs/CHANGELOG.md
files: |
dist/*