Skip to content

chore: add frontend dev release (#939) #5

chore: add frontend dev release (#939)

chore: add frontend dev release (#939) #5

Workflow file for this run

name: Publish dev release
# Publish development release to test pypi on pushes to main
on:
push:
branches:
- main
jobs:
publish_dev_release:
name: 📤 Publish dev release
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- name: 🛑 Cancel Previous Runs
uses: styfle/[email protected]
- name: ⬇️ Checkout repo
uses: actions/checkout@v4
with:
# get tag history for version number
fetch-depth: 0
- uses: pnpm/action-setup@v2
with:
version: 8
- name: ⎔ Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 18
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"
# patch __init__.py version to be of the form
# X.Y.<Z+1>-dev{n-commits-since-last-tag}
- name: 🔨 Patch version number
run: |
# Get the version number and increment patch
# - assumes version is on a line of the form __version__ == "x.y.z"
incremented_version=`grep '__version__' marimo/__init__.py | awk '{print $3}' | awk -F. '{printf "%d.%d.%d", $1, $2, $3+1}'`
# Get the number of commits since last tag
n_commits=`git rev-list $(git describe --tags --abbrev=0)..HEAD --count`
# Form the new version, which is one patch ahead of the last version
# so installing from Test PyPI does the right thing
NEW_VERSION="${incremented_version}-dev${n_commits}"
sed -i "s/__version__ = \".*\"/__version__ = \"$NEW_VERSION\"/" marimo/__init__.py
- name: 📦 Build marimo
run: |
python -m pip install --upgrade pip
pip install build twine
pip install .
python -m build
- name: 📤 Upload to TestPyPI
env:
TWINE_USERNAME: ${{ secrets.TEST_PYPI_USER }}
TWINE_PASSWORD: ${{ secrets.TEST_PYPI_PASSWORD }}
run: twine upload --repository testpypi --skip-existing dist/*
- name: 📦 Update package.json version from CLI
working-directory: frontend
run: |
echo "Updating package.json version to $(marimo --version)"
npm version $(marimo --version) --no-git-tag-version
- name: 📤 Upload to npm
working-directory: frontend
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm publish --access public