-
Notifications
You must be signed in to change notification settings - Fork 1
Description
Background
In PR #10 (#10), we need to establish the initial device branch, including sync script, content migration, and CI validation.
Current Sync Target: TinyGo v0.39.0
Submission Target: All changes should be committed to the device branch and submitted as a PR to the device branch.
Note: This issue only covers the device directory. The machine directory will be handled separately.
Implementation Steps
Step 1: Create Generic Sync Script
Create scripts/sync-from-release.sh (generic script, reusable):
Functionality:
- Download TinyGo release package and extract specified content to target folder
- Download Source:
- URL format:
https://github.com/tinygo-org/tinygo/releases/download/v{VERSION}/tinygo{VERSION}.linux-amd64.tar.gz - Example:
https://github.com/tinygo-org/tinygo/releases/download/v0.39.0/tinygo0.39.0.linux-amd64.tar.gz - Use
linux-amd64version (all platforms have identicalsrc/deviceandsrc/machinecontent)
- URL format:
- Parameters:
- TinyGo version (e.g.,
v0.39.0) - Source path (e.g.,
src/device) - Target folder (e.g.,
device/)
- TinyGo version (e.g.,
Design Goals:
- ✅ Generic and reusable for CI
- ✅ Auto-download from GitHub releases (linux-amd64)
- ✅ Clear parameterized design
Step 2: Complete Initial Migration Using Script
Use the script from Step 1 to migrate src/device from TinyGo v0.39.0 package to device/ directory:
- Specify TinyGo version:
v0.39.0 - Execute script to download and migrate
- Commit:
[SYNC] Update device to TinyGo v0.39.0
Step 3: Create CI Validation
Create .github/workflows/validate-device-sync.yml:
Trigger:
pushtodevicebranchpull_requesttargetingdevicebranch
Validation Logic:
- Use the script from Step 1 to re-extract TinyGo release package
- Compare extracted
src/devicewith repository'sdevice/content - ✅ Verify consistency: ensure
device/exactly matches TinyGo official content - ✅ Verify commit message format:
[SYNC] Update device to TinyGo <version>
Acceptance Criteria
- Generic script
scripts/sync-from-release.shcompleted - Initial device directory sync completed using script (TinyGo v0.39.0)
- CI can verify device content matches TinyGo release
- CI can verify commit message format
- Script documentation complete (README)
- All changes committed to
devicebranch - PR submitted to
devicebranch
Reference Documentation
- PR docs: add TinyGo sync strategy documentation #10: docs: add TinyGo sync strategy documentation #10 (Design reference)
- BRANCH_STRATEGY.md: Commit tagging convention
[SYNC] - TinyGo Releases: https://github.com/tinygo-org/tinygo/releases
Key Design
Script reusability is important:
- Step 2: Manually use script to complete migration
- Step 3: CI automatically uses script to verify consistency
- One script, dual purpose
Note: Only device directory is handled in this issue. The machine directory will be addressed in a separate issue.