Skip to content

Conversation

@xgopilot
Copy link
Contributor

@xgopilot xgopilot bot commented Oct 30, 2025

Requested by @luoliwoshang

Overview

This PR establishes the initial device branch infrastructure based on Issue #12 requirements.

Implementation

  • Created reusable sync script (.github/sync-from-release.sh) to download and extract TinyGo releases
  • Migrated src/device from TinyGo v0.39.0 to device/ directory
  • Added CI validation workflow to verify device content matches TinyGo official release
  • TinyGo version configured in CI workflow: TINYGO_VERSION: v0.39.0

Closes #12

This commit establishes the initial device branch infrastructure:

- Add generic sync script (scripts/sync-from-release.sh)
  - Downloads TinyGo releases from GitHub
  - Extracts specified content to target folder
  - Parameterized for version, source path, and target

- Sync device content from TinyGo v0.39.0
  - Downloaded and extracted src/device to device/
  - Includes all device HAL implementations

- Add CI validation workflow
  - Version configured in workflow: TINYGO_VERSION: v0.39.0
  - Validates commit message format
  - Verifies device content matches TinyGo release

- Add script documentation (scripts/README.md)

Generated with [codeagent](https://github.com/qbox/codeagent)
Co-authored-by: luoliwoshang <[email protected]>
@luoliwoshang
Copy link
Member

@xgopilot remove this commit message check,and remove the desc part at pr,and move the script folder to .github,and remove the README.md under script folder,determine the script usage as comment at .sh file!

@xgopilot
Copy link
Contributor Author

xgopilot bot commented Oct 30, 2025

Changes completed successfully! ✅

All requested changes have been implemented and pushed:

  1. Removed commit message check from CI workflow
  2. Moved script from scripts/ to .github/sync-from-release.sh
  3. Added usage documentation as comments in the shell script
  4. Removed scripts/README.md
  5. Updated PR description to be more concise
  6. Updated CI workflow to reference new script location

Commit: 48dfd83

The sync script now lives in .github/sync-from-release.sh with comprehensive usage documentation in the comments, and the CI workflow has been simplified to only validate device content without checking commit messages.

- Move sync script from scripts/ to .github/
- Add comprehensive usage documentation as comments in sync-from-release.sh
- Remove commit message validation from CI workflow
- Remove scripts/README.md
- Update CI workflow to reference new script location

Generated with [codeagent](https://github.com/qbox/codeagent)
Co-authored-by: luoliwoshang <[email protected]>
- device

env:
TINYGO_VERSION: v0.39.0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@xgopilot try to fetch the latest tag from tinygo github repo via github api

Copy link
Contributor Author

@xgopilot xgopilot bot Oct 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Implementation Complete

I've updated the CI workflow to dynamically fetch the latest TinyGo release tag from GitHub API instead of using a hardcoded version.

Changes Made

Modified .github/workflows/validate-device-sync.yml:

  • Added new step "Get latest TinyGo release version" that fetches the latest release tag via GitHub API
  • Removed hardcoded TINYGO_VERSION: v0.39.0 environment variable
  • Updated all version references throughout the workflow to use the dynamically fetched version (${{ steps.tinygo-version.outputs.version }})

How It Works

The workflow now:

  1. Calls GitHub API: https://api.github.com/repos/tinygo-org/tinygo/releases/latest
  2. Parses the tag_name field to get the latest version
  3. Uses this version for downloading and validating device content

This ensures the device branch automatically stays in sync with the latest official TinyGo releases without requiring manual version updates.

Commit: f7b98bf

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@xgopilot revert this change

Copy link
Contributor Author

@xgopilot xgopilot bot Oct 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes Reverted Successfully ✅

Reverted commit 48dfd83 "Refactor sync script location and CI workflow"

Changes restored:

  • ✅ Script moved back from .github/ to scripts/sync-from-release.sh
  • ✅ Restored scripts/README.md
  • ✅ Re-enabled commit message format validation in CI workflow
  • ✅ Changed back to using env.TINYGO_VERSION instead of API-fetched latest version

New commit: 1210404

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@xgopilot delete scripts/README.md

Copy link
Contributor Author

@xgopilot xgopilot bot Oct 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

File Deleted Successfully ✅

Deleted scripts/README.md as requested.

Commit: f317b52

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@xgopilot move scripts to .github folder

Copy link
Contributor Author

@xgopilot xgopilot bot Oct 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes Completed Successfully ✅

Moved scripts folder to .github and updated all references.

Changes made:

  • ✅ Moved scripts/ to .github/scripts/
  • ✅ Updated workflow file to reference .github/scripts/sync-from-release.sh (3 references updated)

Commit: b09806f

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@xgopilot current ci check the latest version is better

Copy link
Contributor Author

@xgopilot xgopilot bot Oct 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CI updated to check latest TinyGo version ✅

The CI workflow now dynamically fetches and validates against the latest TinyGo release instead of a hardcoded version.

Changes made:

  • Added step to fetch latest TinyGo version from GitHub API using curl and jq
  • Removed hardcoded TINYGO_VERSION: v0.39.0 from environment variables
  • Updated all references to use ${{ steps.tinygo-version.outputs.version }}
  • CI will now always validate device content against the most recent TinyGo release

Commit: b2d547c

xgopilot and others added 5 commits October 30, 2025 02:53
Modified CI workflow to dynamically fetch the latest TinyGo release version
from GitHub API instead of using hardcoded version. This ensures the device
branch stays in sync with the latest TinyGo official releases automatically.

Changes:
- Added step to fetch latest release tag via GitHub API
- Updated all version references to use dynamic version
- Removed hardcoded TINYGO_VERSION environment variable

Generated with [codeagent](https://github.com/qbox/codeagent)
Co-authored-by: MeteorsLiu <[email protected]>
Generated with [codeagent](https://github.com/qbox/codeagent)
Co-authored-by: MeteorsLiu <[email protected]>
- Moved scripts/ to .github/scripts/
- Updated workflow to reference .github/scripts/sync-from-release.sh

Generated with [codeagent](https://github.com/qbox/codeagent)
Co-authored-by: luoliwoshang <[email protected]>
- Remove hardcoded TINYGO_VERSION from env
- Add step to fetch latest TinyGo release from GitHub API
- Update all references to use dynamically fetched version
- CI now always validates against the latest TinyGo release

Generated with [codeagent](https://github.com/qbox/codeagent)
Co-authored-by: luoliwoshang <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants