Skip to content

Commit 5dc6b2e

Browse files
Merge pull request csg-tokyo#88 from maejima-fumika/feature/release-preparation
Release Preparation
2 parents 1c39fad + 38769db commit 5dc6b2e

34 files changed

+801
-8656
lines changed
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
name: Release Components
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
release-microcontroller:
9+
name: Build and Upload microcontroller
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v4
15+
16+
- name: Create ZIP of 'microcontroller' directory
17+
run: zip -r release-microcontroller-${{ github.ref_name }}.zip microcontroller
18+
19+
- name: Upload microcontroller ZIP to Release
20+
uses: actions/upload-release-asset@v1
21+
with:
22+
upload_url: ${{ github.event.release.upload_url }}
23+
asset_path: ./release-microcontroller-${{ github.ref_name }}.zip
24+
asset_name: release-microcontroller-${{ github.ref_name }}.zip
25+
asset_content_type: application/zip
26+
env:
27+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28+
29+
release-lang-and-cli:
30+
name: Publish @bscript/lang and @bscript/cli
31+
runs-on: ubuntu-latest
32+
permissions:
33+
contents: read
34+
id-token: write
35+
36+
steps:
37+
- name: Checkout Repo
38+
uses: actions/checkout@v4
39+
40+
- name: Setup Node.js
41+
uses: actions/setup-node@v4
42+
with:
43+
node-version: 20
44+
registry-url: 'https://registry.npmjs.org'
45+
46+
- name: Verify Version of @bscript/lang Matches Tag
47+
run: |
48+
TAG_VERSION="${GITHUB_REF_NAME#v}"
49+
PKG_VERSION=$(node -p "require('./lang/package.json').version")
50+
51+
if [ "$TAG_VERSION" != "$PKG_VERSION" ]; then
52+
echo "::error::Version Mismatch! Tag ($TAG_VERSION) != ./lang/package.json ($PKG_VERSION)"
53+
exit 1
54+
fi
55+
echo "Version check of @bscript/lang passed: $TAG_VERSION"
56+
57+
- name: Verify Version of @bscript/cli Matches Tag and @bscript/cli Installs Correct @bscript/lang Version
58+
run: |
59+
TAG_VERSION="${GITHUB_REF_NAME#v}"
60+
PKG_VERSION=$(node -p "require('./cli/package.json').version")
61+
DEP_LANG_VERSION=$(node -p "require('./cli/package.json').dependencies['@bscript/lang']")
62+
63+
if [ "$TAG_VERSION" != "$PKG_VERSION" ]; then
64+
echo "::error::Version Mismatch! Tag ($TAG_VERSION) != ./cli/package.json ($PKG_VERSION)"
65+
exit 1
66+
fi
67+
if [ "$TAG_VERSION" != "$DEP_LANG_VERSION" ]; then
68+
echo "::error::Version Mismatch! @bscript/lang@($DEP_LANG_VERSION) in dependencies is incorrect."
69+
exit 1
70+
fi
71+
echo "Version check of @bscript/cli passed: $TAG_VERSION"
72+
73+
- name: Install Dependencies
74+
run: npm ci
75+
76+
- name: Build Packages
77+
run: npm run build --workspaces --if-present
78+
79+
- name: Publish @bscript/lang to npm
80+
working-directory: ./lang
81+
env:
82+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
83+
run: npm publish || echo 'Failed or skipped publishing @bscript/lang'
84+
85+
- name: Publish @bscript/cli to npm
86+
working-directory: ./cli
87+
env:
88+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
89+
run: npm publish || echo 'Failed or skipped publishing @bscript/cli'
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
name: Release Website
2+
3+
on:
4+
release:
5+
types: [published]
6+
workflow_dispatch:
7+
inputs:
8+
version:
9+
description: 'Version number (e.g. 1.0.0)'
10+
required: true
11+
12+
jobs:
13+
versioning:
14+
runs-on: ubuntu-latest
15+
permissions:
16+
contents: write
17+
pull-requests: write
18+
19+
steps:
20+
- name: Checkout main
21+
uses: actions/checkout@v4
22+
with:
23+
ref: main
24+
fetch-depth: 0
25+
26+
- name: Setup Node.js
27+
uses: actions/setup-node@v4
28+
with:
29+
node-version: 20
30+
cache: 'npm'
31+
cache-dependency-path: ./website/package-lock.json
32+
33+
- name: Install dependencies
34+
working-directory: ./website
35+
run: npm ci
36+
37+
- name: Determine Version
38+
id: determine_version
39+
run: |
40+
# 1. Get raw version number (e.g., 1.0.0 or 1.0.5)
41+
if [ "${{ github.event_name }}" == "release" ]; then
42+
TAG_NAME=${{ github.ref_name }}
43+
RAW_VERSION=${TAG_NAME#v}
44+
else
45+
RAW_VERSION=${{ inputs.version }}
46+
fi
47+
echo "Detected raw version: $RAW_VERSION"
48+
49+
# 2. Convert to .x format (e.g., 1.0.5 -> 1.0.x)
50+
BASE_VER=${RAW_VERSION%.*}
51+
DOC_VERSION="${BASE_VER}.x"
52+
echo "Target Docusaurus Version: $DOC_VERSION"
53+
echo "doc_version=$DOC_VERSION" >> $GITHUB_OUTPUT
54+
55+
- name: Clean up existing version (if any)
56+
working-directory: ./website
57+
env:
58+
DOC_VERSION: ${{ steps.determine_version.outputs.doc_version }}
59+
run: |
60+
VERSION_DIR="versioned_docs/version-$DOC_VERSION"
61+
SIDEBAR_FILE="versioned_sidebars/version-$DOC_VERSION-sidebars.json"
62+
VERSIONS_JSON="versions.json"
63+
64+
if [ -d "$VERSION_DIR" ]; then
65+
echo "Version $DOC_VERSION already exists. Cleaning up to overwrite..."
66+
67+
# 1. Remove documentation directory
68+
rm -rf "$VERSION_DIR"
69+
echo "Removed $VERSION_DIR"
70+
71+
# 2. Remove sidebar file
72+
rm -f "$SIDEBAR_FILE"
73+
echo "Removed $SIDEBAR_FILE"
74+
75+
# 3. Remove entry from versions.json using jq
76+
# We filter out the current DOC_VERSION to reset the list state
77+
if [ -f "$VERSIONS_JSON" ]; then
78+
tmp=$(mktemp)
79+
jq --arg v "$DOC_VERSION" 'map(select(. != $v))' "$VERSIONS_JSON" > "$tmp" && mv "$tmp" "$VERSIONS_JSON"
80+
echo "Removed $DOC_VERSION from $VERSIONS_JSON"
81+
fi
82+
else
83+
echo "Version $DOC_VERSION does not exist yet. Ready to create."
84+
fi
85+
86+
- name: Run Docusaurus Versioning
87+
working-directory: ./website
88+
env:
89+
DOC_VERSION: ${{ steps.determine_version.outputs.doc_version }}
90+
run: |
91+
echo "Creating version $DOC_VERSION..."
92+
npm run docusaurus docs:version $DOC_VERSION
93+
94+
- name: Create Pull Request
95+
uses: peter-evans/create-pull-request@v6
96+
with:
97+
token: ${{ secrets.GITHUB_TOKEN }}
98+
commit-message: "docs: update version ${{ steps.determine_version.outputs.doc_version }}"
99+
title: "docs: update version ${{ steps.determine_version.outputs.doc_version }}"
100+
body: "Automated docs update for version ${{ steps.determine_version.outputs.doc_version }}"
101+
branch: "docs-version-${{ steps.determine_version.outputs.doc_version }}"
102+
base: main

.github/workflows/release.yml

Lines changed: 0 additions & 27 deletions
This file was deleted.

.github/workflows/microcontroller_core.yml renamed to .github/workflows/test-microcontroller-core.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: microcontroller core
1+
name: Test Microcontroller Core
22

33
on:
44
push:

.github/workflows/microcontroller_ports_esp32.yml renamed to .github/workflows/test-microcontroller-ports.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: microcontroller ports ESP32
1+
name: Test Microcontroller Ports
22

33
on:
44
push:
@@ -9,7 +9,6 @@ on:
99
- ".github/workflows/*.yml"
1010
- "microcontroller/core/**"
1111
- "microcontroller/ports/esp32/**"
12-
- "modules/esp32/**"
1312

1413
jobs:
1514
build:

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,5 @@ WARNING: this project is in beta stage and is subject to changes of the code-bas
1313
- [Reference Manual](https://csg-tokyo.github.io/bluescript/docs/reference/language/intro)
1414

1515
- 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.
16+
- 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.
1617

0 commit comments

Comments
 (0)