Skip to content

0.9.0 (#2490)

0.9.0 (#2490) #204

Workflow file for this run

name: Publish release
# release a new version of marimo on tag push
on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+'
workflow_dispatch: {}
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: marimo
REGISTRY: ghcr.io
IMAGE_NAME: marimo-team/marimo
jobs:
publish_release:
name: 📤 Publish release
runs-on: ubuntu-latest
defaults:
run:
shell: bash
outputs:
marimo_version: ${{ steps.get_version.outputs.marimo_version }}
steps:
- name: 🛑 Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.12.1
- name: ⬇️ Checkout repo
uses: actions/checkout@v4
- uses: pnpm/action-setup@v2
with:
version: 9
- name: ⎔ Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
cache-dependency-path: '**/pnpm-lock.yaml'
registry-url: 'https://registry.npmjs.org'
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: 📦 Build frontend
run: make fe
- name: 🐍 Setup Python 3.12
uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: 'pip'
# This does not work when running `marimo --version`
# - name: 🐍 Setup uv
# uses: yezz123/setup-uv@v4
# with:
# uv-venv: marimo-venv
- name: 📦 Build marimo
run: |
pip install build twine
pip install .
python -m build
- name: 📤 Upload to PyPI
env:
TWINE_USERNAME: ${{ secrets.PYPI_USER }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: twine upload --skip-existing dist/*
- name: 🔨 Get version
id: get_version
run: |
echo "marimo_version=$(python -m marimo --version)" >> $GITHUB_OUTPUT
- name: 📦 Update package.json version from CLI
working-directory: frontend
run: |
echo "Updating package.json version to ${{ steps.get_version.outputs.marimo_version }}"
npm version ${{ steps.get_version.outputs.marimo_version }} --no-git-tag-version
- name: 📤 Upload wasm to npm
working-directory: frontend
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm publish --access public
- name: 📦 Update package.json name to @marimo-team/islands
working-directory: frontend
run: |
sed -i 's/"name": "@marimo-team\/frontend"/"name": "@marimo-team\/islands"/' package.json
- name: 📦 Rebuild frontend
working-directory: frontend
env:
NODE_ENV: production
VITE_MARIMO_ISLANDS: 'true'
VITE_MARIMO_VERSION: ${{ steps.get_version.outputs.marimo_version }}
run: |
pnpm turbo build:islands
./islands/validate.sh
- name: 📤 Upload islands to npm
working-directory: frontend
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm publish --access public
publish_docker:
name: 🐋 Publish Docker images
runs-on: ubuntu-latest
needs: [publish_release]
# Don't error while this is in BETA
continue-on-error: true
permissions:
contents: read
packages: write
steps:
- name: 🛑 Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.12.1
- name: ⬇️ Checkout repo
uses: actions/checkout@v4
- name: 🐋 Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: 🐋 Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: 🐋 Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: 🧪 Build docker image for testing
uses: docker/build-push-action@v6
with:
context: .
file: ./docker/Dockerfile
# Don't push test image
push: false
load: true
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:test
target: slim
build-args: |
marimo_version=${{ needs.publish_release.outputs.marimo_version }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: 🧪 Test docker build
run: |
docker run -d -e PORT=9090 -p 9090:9090 --name test_container ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:test
sleep 2
curl -f http://localhost:9090/health || (docker logs test_container && exit 1)
docker stop test_container
docker rm test_container
- name: 📦 Build and push Docker images (slim)
uses: docker/build-push-action@v6
with:
context: .
file: ./docker/Dockerfile
push: true
tags: |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ needs.publish_release.outputs.marimo_version }}
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
target: slim
platforms: linux/amd64,linux/arm64
build-args: |
marimo_version=${{ needs.publish_release.outputs.marimo_version }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: 📦 Build and push Docker images (data)
uses: docker/build-push-action@v6
with:
context: .
file: ./docker/Dockerfile
push: true
tags: |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ needs.publish_release.outputs.marimo_version }}-data
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest-data
target: data
platforms: linux/amd64,linux/arm64
build-args: |
marimo_version=${{ needs.publish_release.outputs.marimo_version }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: 📦 Build and push Docker images (sql)
uses: docker/build-push-action@v6
with:
context: .
file: ./docker/Dockerfile
push: true
tags: |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ needs.publish_release.outputs.marimo_version }}-sql
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest-sql
target: sql
platforms: linux/amd64,linux/arm64
build-args: |
marimo_version=${{ needs.publish_release.outputs.marimo_version }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max