What
Add an automatic sync job that copies all driver examples from lib/*/examples/*.py into a drivers/ directory in steamicc/micropython-steami-sample after each release.
Why
Driver examples live in this repo (close to the code they validate) but students look for examples in micropython-steami-sample. Currently there is no link between the two repos — the 94 example files across 15 drivers are invisible to students unless they browse this repo directly.
How
1. Create scripts/sync_examples.sh
A simple shell script that:
- Takes a version string and a target directory as arguments
- Deletes
<target>/drivers/ and recreates it from lib/*/examples/*.py
- Generates a
drivers/README.md with the version and a "do not edit" notice
2. Add a sync-examples job to .github/workflows/release.yml
After semantic-release publishes a new version:
- Checkout this repo at the release tag
- Checkout
micropython-steami-sample
- Run
scripts/sync_examples.sh
- Commit and push to
micropython-steami-sample
Uses the same GitHub App token already configured for semantic-release.
3. Update CONTRIBUTING.md
Short mention of the sync mechanism so contributors know their examples will propagate to the sample repo.
Blocked by
Verification
Run scripts/sync_examples.sh v0.23.1 /tmp/sample-test locally and verify the drivers/ directory contains all expected files.
What
Add an automatic sync job that copies all driver examples from
lib/*/examples/*.pyinto adrivers/directory insteamicc/micropython-steami-sampleafter each release.Why
Driver examples live in this repo (close to the code they validate) but students look for examples in
micropython-steami-sample. Currently there is no link between the two repos — the 94 example files across 15 drivers are invisible to students unless they browse this repo directly.How
1. Create
scripts/sync_examples.shA simple shell script that:
<target>/drivers/and recreates it fromlib/*/examples/*.pydrivers/README.mdwith the version and a "do not edit" notice2. Add a
sync-examplesjob to.github/workflows/release.ymlAfter semantic-release publishes a new version:
micropython-steami-samplescripts/sync_examples.shmicropython-steami-sampleUses the same GitHub App token already configured for semantic-release.
3. Update CONTRIBUTING.md
Short mention of the sync mechanism so contributors know their examples will propagate to the sample repo.
Blocked by
drivers/is consistent)Verification
Run
scripts/sync_examples.sh v0.23.1 /tmp/sample-testlocally and verify thedrivers/directory contains all expected files.