Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
1486c1b
wip. task create zip
dido18 Oct 24, 2025
d755d0e
Update sketch.yaml to specify commit for Arduino_Modulino to avoid bu…
dido18 Oct 24, 2025
b127daf
chore: update .gitignore and README for task adjustments; remove obso…
dido18 Oct 24, 2025
74c7a63
feat: add GitHub Actions workflow for automated release process
dido18 Oct 25, 2025
0e60396
fix: update release workflow to include workflow_dispatch and correct…
dido18 Oct 25, 2025
39d3684
fix: correct Go version specification in release workflow
dido18 Oct 25, 2025
a0fbc81
refactor: simplify task execution in release workflow by removing Go …
dido18 Oct 25, 2025
3d43542
fix: correct command execution context for npm install and build in s…
dido18 Oct 25, 2025
8ee4041
feat: add installer script for scratch-arduino-app and update release…
dido18 Oct 25, 2025
1b29397
fix: uncomment zip creation step and correct syntax for artifact name…
dido18 Oct 25, 2025
b21104d
fix: correct environment variable reference for artifact name in rele…
dido18 Oct 25, 2025
9d3c5f1
fix
dido18 Oct 25, 2025
eeb8596
fix
dido18 Oct 25, 2025
2e81ecf
fix: update installation paths to use HOME variable for consistency
dido18 Oct 25, 2025
1fa1c05
fix: remove commented-out zip creation step in release workflow
dido18 Oct 25, 2025
9852ed8
fix: update release workflow to create zip and upload artifacts
dido18 Oct 25, 2025
ca5c8b2
fix: add missing newline and correct indentation in release workflow
dido18 Oct 25, 2025
98b8452
fix: simplify download command in installer script
dido18 Oct 25, 2025
2112b51
fix: correct token variable name in release workflow
dido18 Oct 25, 2025
3ad88fe
fix: update token reference in release workflow and remove unnecessar…
dido18 Oct 25, 2025
b10eb99
fix: streamline zip creation process and enhance versioning in Taskfile
dido18 Oct 25, 2025
15059dc
fix: simplify installer script by removing unnecessary checks and usi…
dido18 Oct 25, 2025
9e9726b
fix: update installation instructions and improve download process in…
dido18 Oct 26, 2025
8f48728
fix: remove redundant installation messages and streamline script exe…
dido18 Oct 26, 2025
9b2684c
fix: remove redundant cleanup step in installation script
dido18 Oct 26, 2025
0b6c5b0
fix: add error handling for missing zip file in installation script
dido18 Oct 26, 2025
c8423f7
fix: clarify download directory in installation script
dido18 Oct 26, 2025
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
51 changes: 51 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Release

on:
workflow_dispatch:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+*"

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v5
with:
fetch-depth: 0

- name: Show tag info
run: echo "Building release for tag ${{ github.ref_name }}"

- name: Install Go
uses: actions/setup-go@v5
with:
go-version: 1.25

- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version: '18'

- name: Install Task
uses: arduino/setup-task@v2

- name: Scratch init
run: |
task scratch:init

- name: Create build
run: |
task app:build

- name: Create zip
run: task app:zip
env:
APP_VERSION: ${{ github.ref_name }}

- uses: ncipollo/release-action@v1
with:
artifacts: "build/scratch-arduino-app*.zip"
allowUpdates: true
token: ${{ github.token }}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
scratch-editor
Arduino_Modulino
build/
23 changes: 10 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
# Scratch for Arduino Uno Q

Getting started:
1. Connect the Arduino Uno Q board
2. Upload the `scratch-arduino-app` into the board:
``` sh
task app:upload
```
3. Start the App
- via the ArduinoAppLab
- via command line `arduino-app-cli app start user:scratch-arduino-app`
## Installation

4. Open the `<IP_OR_BOARD_NAME>:7000`
- Connect to the board using `adb` following https://docs.arduino.cc/software/app-lab/tutorials/cli/ and open the `adb shell`
- From inside the board, Install the latest `scratch-arduino-app` into the board running the command:
```
curl -sSL https://raw.githubusercontent.com/dido18/scratch-arduino-app/main/install.sh | bash
```
- Open the `ArduinoAppLab` and start the app
- Visit the `<IP_OR_BOARD_NAME>:7000` to open the Scratch App.

### Local dev
### Local development
- `task scratch:init`
- `task scratch:patch`
- `task scratch:start`
- `task scratch:local:start`
- change the `const wsServerURL = `<YOUR_IP>:7000`;` in the `index.js`
- Open local scratch on http://localhost:8601/
86 changes: 50 additions & 36 deletions Taskfile.yaml
Original file line number Diff line number Diff line change
@@ -1,57 +1,71 @@
version: "3"
vars:
SCRATCH_EDITOR_VERSION: v12.0.1
ARDUINO_APP_BASE_PATH: /home/arduino/ArduinoApps/scratch-arduino-app

tasks:
app:upload:
desc: "Upload app files to the Arduino Board"
cmds:
- adb push ./app.yaml {{ .ARDUINO_APP_BASE_PATH }}/app.yaml
- task: modulino:patch
- adb push ./sketch {{ .ARDUINO_APP_BASE_PATH }}/
- adb push ./python/ {{ .ARDUINO_APP_BASE_PATH }}/
- adb push ./assets/ {{ .ARDUINO_APP_BASE_PATH }}/

modulino:patch:
desc: "Patch Arduino Modulino and put it in the sketch folder"
cmds:
# See https://github.com/arduino-libraries/Arduino_Modulino/pull/42
# Any Version<0.6.0 the build fails if Both modulino and ArduinoLedMatrix are used in the UnoQ
- rm -rf sketch/Arduino_Modulino && mkdir -p sketch/Arduino_Modulino
- git clone --depth 1 git@github.com:arduino-libraries/Arduino_Modulino.git sketch/Arduino_Modulino
- cd sketch/Arduino_Modulino && git checkout 480e9d183a3b3dede0c68170e469410a6d710bee

scratch:init:
cmds:
- rm -rf scratch-editor
- git clone --depth 1 --branch {{ .SCRATCH_EDITOR_VERSION }} https://github.com/scratchfoundation/scratch-editor.git
- task: scratch:install

scratch:install:
dir: scratch-editor
cmds:
- npm install
- npm run build
- cd scratch-editor && npm install
- cd scratch-editor && npm run build
- task scratch:patch

scratch:patch:
cmds:
- cd scratch-editor/packages/scratch-gui && node ../../../scratch-arduino-extensions/scripts/patch-gui.js

scratch:start:
scratch:local:start:
dir: scratch-editor
cmds:
- npm start --workspace @scratch/scratch-gui

scratch:clean:
app:build:
desc: "Copy app files (python, assets, app.yaml) to a build directory"
cmds:
- rm -rf scratch-editor

scratch:assets:
desc: "Build Scratch GUI files and copy to the assets folder"
- mkdir -p build/scratch-arduino-app
- cp ./app.yaml build/scratch-arduino-app/app.yaml
- cp -r ./sketch/ build/scratch-arduino-app/sketch
- cp -r ./python/ build/scratch-arduino-app/python
- task scratch:build
- mkdir -p build/scratch-arduino-app/assets
- cp scratch-editor/packages/scratch-gui/build/index.html build/scratch-arduino-app/assets/index.html
- cp scratch-editor/packages/scratch-gui/build/gui.js build/scratch-arduino-app/assets/gui.js
- mkdir -p build/scratch-arduino-app/assets/static
- cp -r scratch-editor/packages/scratch-gui/build/static/blocks-media build/scratch-arduino-app/assets/static/blocks-media

scratch:build:
desc: "Build Scratch GUI files"
dir: scratch-editor/packages/scratch-gui
cmds:
- npm run build:dev --workspace @scratch/scratch-gui
- cp build/index.html ../../../assets/index.html
- cp build/gui.js ../../../assets/gui.js
## copy (some) of the static files
- mkdir -p ../../../assets/static/blocks-media && cp -r build/static/blocks-media ../../../assets/static/

board:app:upload:
desc: "Upload zip file to Arduino board, unzip and deploy to /home/arduino/ArduinoApps"
cmds:
- task app:zip
- |
ZIP_FILE=$(ls -t build/scratch-arduino-app-*.zip 2>/dev/null | head -n1)
if [ -z "$ZIP_FILE" ]; then
echo "No zip file found. Run 'task app:zip' first."
exit 1
fi
adb push "$ZIP_FILE" /tmp/
ZIP_BASENAME=$(basename "$ZIP_FILE")
adb shell "cd /tmp && unzip -o $ZIP_BASENAME && mkdir -p /home/arduino/ArduinoApps && rm -rf /home/arduino/ArduinoApps/scratch-arduino-app && mv scratch-arduino-app /home/arduino/ArduinoApps/ && rm $ZIP_BASENAME"
echo "App deployed to /home/arduino/ArduinoApps/scratch-arduino-app"

app:zip:
desc: "Create a zip file with version (defaults to git commit hash)"
vars:
APP_VERSION:
sh: echo "${APP_VERSION:-$(git rev-parse --short HEAD 2>/dev/null || echo 'unknown')}"
cmds:
- |
if [ ! -d "build/scratch-arduino-app" ]; then
echo "Build folder does not exist. Run 'task app:build' first."
exit 1
fi
- echo "Creating zip with version {{.APP_VERSION}}"
- cd build && zip -r scratch-arduino-app-{{.APP_VERSION}}.zip scratch-arduino-app && cd ..

2 changes: 1 addition & 1 deletion app.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: scratch-arduino-app
description: Controll the Uno-Q borad using Scractch blocks
description: Control the Uno-Q board using Scratch blocks
ports:
- 7000
bricks:
Expand Down
Loading