-
Notifications
You must be signed in to change notification settings - Fork 153
104 lines (87 loc) · 2.85 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
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
jobs:
publish_release:
name: 📤 Publish release
runs-on: ubuntu-latest
defaults:
run:
shell: bash
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: 8
- 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.10
uses: actions/setup-python@v5
with:
python-version: "3.10"
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: 📦 Update package.json version from CLI
working-directory: frontend
run: |
echo "Updating package.json version to $(python -m marimo --version)"
echo "MARIMO_VERSION=$(python -m marimo --version)" >> $GITHUB_ENV
npm version $(python -m 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: ${{ env.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