Skip to content

A reactive notebook for Python — run reproducible experiments, query with SQL, execute as a script, deploy as an app, and version with git. Stored as pure Python. All in a modern, AI-native editor.

ci: oidc (#7713)

Myles Scolnick59d696b78046
diff --git a/.github/workflows/dev-release.yml b/.github/workflows/dev-release.yml
index 1e9c72d317..129129b252 100644
--- a/.github/workflows/dev-release.yml
+++ b/.github/workflows/dev-release.yml
@@ -9,6 +9,7 @@ on:
permissions:
contents: read
pull-requests: write
+ id-token: write # Required for OIDC
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
@@ -22,6 +23,9 @@ jobs:
run:
shell: bash
+ outputs:
+ marimo_version: ${{ steps.get_version.outputs.marimo_version }}
+
steps:
- name: 🛑 Cancel Previous Runs
uses: styfle/[email protected]
@@ -39,9 +43,6 @@ jobs:
node-version: 22
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
@@ -54,6 +55,7 @@ jobs:
# patch pyproject.toml version to be of the form
# X.Y.<Z+1>-dev{n-commits-since-last-tag}
- name: 🔨 Patch version number
+ id: get_version
run: |
# Get the version number and increment patch
# - assumes version is on a line of the form __version__ == "x.y.z"
@@ -65,6 +67,7 @@ jobs:
MARIMO_VERSION="${incremented_version}-dev${n_commits}"
# Set the version in the environment for later steps
echo "MARIMO_VERSION=$MARIMO_VERSION" >> $GITHUB_ENV
+ echo "marimo_version=$MARIMO_VERSION" >> $GITHUB_OUTPUT
uv version "$MARIMO_VERSION"
env:
NO_COLOR: 1
@@ -102,25 +105,19 @@ jobs:
echo "Updating package.json version to ${{ env.MARIMO_VERSION }}"
npm version ${{ env.MARIMO_VERSION }} --no-git-tag-version
- - name: 📤 Upload wasm to npm (@marimo-team/frontend)
- working-directory: frontend
- env:
- NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- run: |
- for i in {1..3}; do
- npm publish --access public && break || {
- echo "Publish attempt $i failed, retrying..."
- sleep 10
- }
- done
+ - name: 📦 Upload frontend artifact for npm publish
+ uses: actions/upload-artifact@v6
+ with:
+ name: frontend-dev
+ path: frontend/
+ retention-days: 1
- 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
+ - name: 📦 Rebuild frontend for islands
working-directory: frontend
env:
NODE_ENV: production
@@ -130,22 +127,45 @@ jobs:
pnpm turbo build:islands
./islands/validate.sh
- - name: 📤 Upload islands to npm (@marimo-team/islands)
- working-directory: frontend
- env:
- NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- run: |
- for i in {1..3}; do
- npm publish --access public && break || {
- echo "Publish attempt $i failed, retrying..."
- sleep 10
- }
- done
-
+ - name: 📦 Upload islands artifact for npm publish
+ uses: actions/upload-artifact@v6
+ with:
+ name: frontend-islands-dev
+ path: frontend/
+ retention-days: 1
+
+ publish_wasm_dev:
+ name: 📤 Publish @marimo-team/frontend to npm
+ needs: publish_dev_release
+ uses: ./.github/workflows/publish-npm.yml
+ with:
+ package-artifact-name: frontend-dev
+ working-directory: '.'
+ permissions:
+ id-token: write
+ contents: read
+
+ publish_islands_dev:
+ name: 📤 Publish @marimo-team/islands to npm
+ needs: publish_dev_release
+ uses: ./.github/workflows/publish-npm.yml
+ with:
+ package-artifact-name: frontend-islands-dev
+ working-directory: '.'
+ permissions:
+ id-token: write
+ contents: read
+
+ comment_pr:
+ name: 📝 Comment PR
+ needs: [publish_dev_release, publish_wasm_dev, publish_islands_dev]
+ runs-on: ubuntu-latest
+ steps:
- name: 📝 Comment PR
uses: actions/github-script@v7
continue-on-error: true
+ env:
+ MARIMO_VERSION: ${{ needs.publish_dev_release.outputs.marimo_version }}
with:
script: |
try {
diff --git a/.github/workflows/marimo-bot.yml b/.github/workflows/marimo-bot.yml
index 68553c630b..03cdf32c8c 100644
--- a/.github/workflows/marimo-bot.yml
+++ b/.github/workflows/marimo-bot.yml
@@ -7,6 +7,7 @@ on:
permissions:
contents: read
pull-requests: write
+ id-token: write # Required for OIDC
env:
TURBO_TEAM: marimo
@@ -31,6 +32,10 @@ jobs:
run:
shell: bash
+ outputs:
+ marimo_version: ${{ steps.get_version.outputs.marimo_version }}
+ comment_id: ${{ steps.comment.outputs.result }}
+
steps:
- name: 🛑 Cancel Previous Runs
uses: styfle/[email protected]
@@ -83,9 +88,6 @@ jobs:
node-version: 22
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
@@ -103,6 +105,7 @@ jobs:
# This must be a valid semver version from
# https://packaging.python.org/en/latest/discussions/versioning/
- name: 🔨 Patch version number
+ id: get_version
run: |
# Get the version number
current_version=`uv version --short`
@@ -112,6 +115,7 @@ jobs:
MARIMO_VERSION="${current_version}-dev9${random_digits}"
# Set the version in the environment for later steps
echo "MARIMO_VERSION=$MARIMO_VERSION" >> $GITHUB_ENV
+ echo "marimo_version=$MARIMO_VERSION" >> $GITHUB_OUTPUT
uv version "$MARIMO_VERSION"
env:
NO_COLOR: 1
@@ -134,26 +138,43 @@ jobs:
echo "Updating package.json version to ${{ env.MARIMO_VERSION }}"
npm version ${{ env.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: |
- for i in {1..3}; do
- npm publish --access public && break || {
- echo "Publish attempt $i failed, retrying..."
- sleep 10
- }
- done
+ - name: 📦 Upload frontend artifact for npm publish
+ uses: actions/upload-artifact@v6
+ with:
+ name: frontend-test-branch
+ path: frontend/
+ retention-days: 1
+
+ publish_wasm_test:
+ name: 📤 Publish @marimo-team/frontend to npm
+ needs: create-test-release
+ uses: ./.github/workflows/publish-npm.yml
+ with:
+ package-artifact-name: frontend-test-branch
+ working-directory: '.'
+ permissions:
+ id-token: write
+ contents: read
+
+ update_pr_comment:
+ name: 📝 Update PR Comment
+ needs: [create-test-release, publish_wasm_test]
+ runs-on: ubuntu-latest
+ if: always()
+ steps:
+ - name: ⬇️ Checkout repo
+ uses: actions/checkout@v4
- - name: 📝 Update PR Comment
+ - name: 📝 Update PR Comment on Success
+ if: needs.publish_wasm_test.result == 'success'
uses: actions/github-script@v7
continue-on-error: true
+ env:
+ MARIMO_VERSION: ${{ needs.create-test-release.outputs.marimo_version }}
with:
script: |
try {
- const commentId = ${{steps.comment.outputs.result}}
+ const commentId = ${{ needs.create-test-release.outputs.comment_id }}
console.log(`Updating comment with ID: ${commentId}`);
await github.rest.issues.updateComment({
owner: context.repo.owner,
@@ -166,12 +187,13 @@ jobs:
}
- name: 📝 Update PR Comment on Failure
- if: failure()
+ if: needs.create-test-release.result == 'failure' || needs.publish_wasm_test.result == 'failure'
uses: actions/github-script@v7
+ continue-on-error: true
with:
script: |
try {
- const commentId = ${{steps.comment.outputs.result}}
+ const commentId = ${{ needs.create-test-release.outputs.comment_id }}
console.log(`Updating comment with ID: ${commentId}`);
await github.rest.issues.updateComment({
owner: context.repo.owner,
diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml
index 2231c240f9..828838b24d 100644
--- a/.github/workflows/playwright.yml
+++ b/.github/workflows/playwright.yml
@@ -137,7 +137,7 @@ jobs:
# path: frontend/e2e-tests/screenshots
- name: 📊 Upload report
- uses: actions/upload-artifact@v4
+ uses: actions/upload-artifact@v6
if: always()
with:
name: playwright-report
diff --git a/.github/workflows/publish-npm.yml b/.github/workflows/publish-npm.yml
new file mode 100644
index 0000000000..7579a1b0b0
--- /dev/null
+++ b/.github/workflows/publish-npm.yml
@@ -0,0 +1,46 @@
+name: Publish Package to npm
+
+on:
+ workflow_call:
+ inputs:
+ package-artifact-name:
+ required: true
+ type: string
+ description: 'Name of the artifact containing the built package'
+ working-directory:
+ required: false
+ type: string
+ default: '.'
+ description: 'Directory within the artifact to publish from'
+
+jobs:
+ publish:
+ runs-on: ubuntu-latest
+ permissions:
+ id-token: write # Required for OIDC authentication and provenance
+ contents: read
+ steps:
+ - name: 📦 Setup Node.js
+ uses: actions/setup-node@v4
+ with:
+ node-version: 22
+ registry-url: 'https://registry.npmjs.org'
+
+ - name: ⬆️ Upgrade npm for OIDC support
+ run: npm install -g npm@latest
+
+ - name: 📥 Download built package artifact
+ uses: actions/download-artifact@v4
+ with:
+ name: ${{ inputs.package-artifact-name }}
+ path: ${{ inputs.working-directory }}
+
+ - name: 📤 Publish to npm
+ working-directory: ${{ inputs.working-directory }}
+ run: |
+ for i in {1..3}; do
+ npm publish --access public --provenance && break || {
+ echo "Publish attempt $i failed, retrying..."
+ sleep 10
+ }
+ done
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 6bb252997d..a14eb7bffb 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -9,6 +9,7 @@ on:
permissions:
contents: read
+ id-token: write # Required for OIDC
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
@@ -42,9 +43,6 @@ jobs:
node-version: 22
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
@@ -74,25 +72,19 @@ jobs:
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: |
- for i in {1..3}; do
- npm publish --access public && break || {
- echo "Publish attempt $i failed, retrying..."
- sleep 10
- }
- done
+ - name: 📦 Upload frontend artifact for npm publish
+ uses: actions/upload-artifact@v6
+ with:
+ name: frontend
+ path: frontend/
+ retention-days: 1
- 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
+ - name: 📦 Rebuild frontend for islands
working-directory: frontend
env:
NODE_ENV: production
@@ -102,18 +94,34 @@ jobs:
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: |
- for i in {1..3}; do
- npm publish --access public && break || {
- echo "Publish attempt $i failed, retrying..."
- sleep 10
- }
- done
+ - name: 📦 Upload islands artifact for npm publish
+ uses: actions/upload-artifact@v6
+ with:
+ name: frontend-islands
+ path: frontend/
+ retention-days: 1
+
+ publish_wasm:
+ name: 📤 Publish @marimo-team/frontend to npm
+ needs: publish_release
+ uses: ./.github/workflows/publish-npm.yml
+ with:
+ package-artifact-name: frontend
+ working-directory: '.'
+ permissions:
+ id-token: write
+ contents: read
+
+ publish_islands:
+ name: 📤 Publish @marimo-team/islands to npm
+ needs: publish_release
+ uses: ./.github/workflows/publish-npm.yml
+ with:
+ package-artifact-name: frontend-islands
+ working-directory: '.'
+ permissions:
+ id-token: write
+ contents: read
publish_docker:
name: 🐋 Publish Docker images
diff --git a/.github/workflows/test_cli.yaml b/.github/workflows/test_cli.yaml
index 4f48b62af5..72e5c4be89 100644
--- a/.github/workflows/test_cli.yaml
+++ b/.github/workflows/test_cli.yaml
@@ -89,7 +89,7 @@ jobs:
- name: Run LSP binary
run: ./scripts/test-lsp.sh
- name: Upload wheel
- uses: actions/upload-artifact@v4
+ uses: actions/upload-artifact@v6
with:
name: testwheel
path: dist/*.whl