Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 89 additions & 0 deletions .github/workflows/release-components.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: Release Components

on:
release:
types: [published]

jobs:
release-microcontroller:
name: Build and Upload microcontroller
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Create ZIP of 'microcontroller' directory
run: zip -r release-microcontroller-${{ github.ref_name }}.zip microcontroller

- name: Upload microcontroller ZIP to Release
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./release-microcontroller-${{ github.ref_name }}.zip
asset_name: release-microcontroller-${{ github.ref_name }}.zip
asset_content_type: application/zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

release-lang-and-cli:
name: Publish @bscript/lang and @bscript/cli
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write

steps:
- name: Checkout Repo
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
registry-url: 'https://registry.npmjs.org'

- name: Verify Version of @bscript/lang Matches Tag
run: |
TAG_VERSION="${GITHUB_REF_NAME#v}"
PKG_VERSION=$(node -p "require('./lang/package.json').version")

if [ "$TAG_VERSION" != "$PKG_VERSION" ]; then
echo "::error::Version Mismatch! Tag ($TAG_VERSION) != ./lang/package.json ($PKG_VERSION)"
exit 1
fi
echo "Version check of @bscript/lang passed: $TAG_VERSION"

- name: Verify Version of @bscript/cli Matches Tag and @bscript/cli Installs Correct @bscript/lang Version
run: |
TAG_VERSION="${GITHUB_REF_NAME#v}"
PKG_VERSION=$(node -p "require('./cli/package.json').version")
DEP_LANG_VERSION=$(node -p "require('./cli/package.json').dependencies['@bscript/lang']")

if [ "$TAG_VERSION" != "$PKG_VERSION" ]; then
echo "::error::Version Mismatch! Tag ($TAG_VERSION) != ./cli/package.json ($PKG_VERSION)"
exit 1
fi
if [ "$TAG_VERSION" != "$DEP_LANG_VERSION" ]; then
echo "::error::Version Mismatch! @bscript/lang@($DEP_LANG_VERSION) in dependencies is incorrect."
exit 1
fi
echo "Version check of @bscript/cli passed: $TAG_VERSION"

- name: Install Dependencies
run: npm ci

- name: Build Packages
run: npm run build --workspaces --if-present

- name: Publish @bscript/lang to npm
working-directory: ./lang
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm publish || echo 'Failed or skipped publishing @bscript/lang'

- name: Publish @bscript/cli to npm
working-directory: ./cli
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm publish || echo 'Failed or skipped publishing @bscript/cli'
102 changes: 102 additions & 0 deletions .github/workflows/release-website.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
name: Release Website

on:
release:
types: [published]
workflow_dispatch:
inputs:
version:
description: 'Version number (e.g. 1.0.0)'
required: true

jobs:
versioning:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write

steps:
- name: Checkout main
uses: actions/checkout@v4
with:
ref: main
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
cache-dependency-path: ./website/package-lock.json

- name: Install dependencies
working-directory: ./website
run: npm ci

- name: Determine Version
id: determine_version
run: |
# 1. Get raw version number (e.g., 1.0.0 or 1.0.5)
if [ "${{ github.event_name }}" == "release" ]; then
TAG_NAME=${{ github.ref_name }}
RAW_VERSION=${TAG_NAME#v}
else
RAW_VERSION=${{ inputs.version }}
fi
echo "Detected raw version: $RAW_VERSION"

# 2. Convert to .x format (e.g., 1.0.5 -> 1.0.x)
BASE_VER=${RAW_VERSION%.*}
DOC_VERSION="${BASE_VER}.x"
echo "Target Docusaurus Version: $DOC_VERSION"
echo "doc_version=$DOC_VERSION" >> $GITHUB_OUTPUT

- name: Clean up existing version (if any)
working-directory: ./website
env:
DOC_VERSION: ${{ steps.determine_version.outputs.doc_version }}
run: |
VERSION_DIR="versioned_docs/version-$DOC_VERSION"
SIDEBAR_FILE="versioned_sidebars/version-$DOC_VERSION-sidebars.json"
VERSIONS_JSON="versions.json"

if [ -d "$VERSION_DIR" ]; then
echo "Version $DOC_VERSION already exists. Cleaning up to overwrite..."

# 1. Remove documentation directory
rm -rf "$VERSION_DIR"
echo "Removed $VERSION_DIR"

# 2. Remove sidebar file
rm -f "$SIDEBAR_FILE"
echo "Removed $SIDEBAR_FILE"

# 3. Remove entry from versions.json using jq
# We filter out the current DOC_VERSION to reset the list state
if [ -f "$VERSIONS_JSON" ]; then
tmp=$(mktemp)
jq --arg v "$DOC_VERSION" 'map(select(. != $v))' "$VERSIONS_JSON" > "$tmp" && mv "$tmp" "$VERSIONS_JSON"
echo "Removed $DOC_VERSION from $VERSIONS_JSON"
fi
else
echo "Version $DOC_VERSION does not exist yet. Ready to create."
fi

- name: Run Docusaurus Versioning
working-directory: ./website
env:
DOC_VERSION: ${{ steps.determine_version.outputs.doc_version }}
run: |
echo "Creating version $DOC_VERSION..."
npm run docusaurus docs:version $DOC_VERSION

- name: Create Pull Request
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "docs: update version ${{ steps.determine_version.outputs.doc_version }}"
title: "docs: update version ${{ steps.determine_version.outputs.doc_version }}"
body: "Automated docs update for version ${{ steps.determine_version.outputs.doc_version }}"
branch: "docs-version-${{ steps.determine_version.outputs.doc_version }}"
base: main
27 changes: 0 additions & 27 deletions .github/workflows/release.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: microcontroller core
name: Test Microcontroller Core

on:
push:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: microcontroller ports ESP32
name: Test Microcontroller Ports

on:
push:
Expand All @@ -9,7 +9,6 @@ on:
- ".github/workflows/*.yml"
- "microcontroller/core/**"
- "microcontroller/ports/esp32/**"
- "modules/esp32/**"

jobs:
build:
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ WARNING: this project is in beta stage and is subject to changes of the code-bas
- [Reference Manual](https://csg-tokyo.github.io/bluescript/docs/reference/language/intro)

- Fumika Mochizuki, Tetsuro Yamazaki, Shigeru Chiba, ["Interactive Programming for Microcontrollers by Offloading Dynamic Incremental Compilation"](https://dl.acm.org/doi/10.1145/3679007.3685062), MPLR 2024, pp. 28-40, ACM, 2024.
- Fumika Mochizuki, Tetsuro Yamazaki, Shigeru Chiba, ["BlueScript: A Disaggregated Virtual Machine for Microcontrollers"](https://programming-journal.org/2025/10/21/), The Art, Science, and Engineering of Programming, 2025, Vol. 10, Issue 3, Article 21.

Loading