Skip to content

Establish Initial device Branch Based on PR #10 Design #12

@luoliwoshang

Description

@luoliwoshang

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-amd64 version (all platforms have identical src/device and src/machine content)
  • Parameters:
    • TinyGo version (e.g., v0.39.0)
    • Source path (e.g., src/device)
    • Target folder (e.g., device/)

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:

  • push to device branch
  • pull_request targeting device branch

Validation Logic:

  • Use the script from Step 1 to re-extract TinyGo release package
  • Compare extracted src/device with repository's device/ 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.sh completed
  • 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 device branch
  • PR submitted to device branch

Reference Documentation

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions