Skip to content

Add GitHub Actions release workflow for PlatformIO Registry - #36

Merged
JamesSmartCell merged 2 commits into
masterfrom
cursor/release-workflow-f6c1
Nov 16, 2026
Merged

JamesSmartCell merged 2 commits into
masterfrom
cursor/release-workflow-f6c1

Conversation

@JamesSmartCell

@JamesSmartCell JamesSmartCell commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

Summary

This PR adds a fully automated GitHub Actions workflow for publishing Web3E releases to the PlatformIO Registry.

Changes

1. Release Workflow (.github/workflows/release.yml)

Triggers:

  • release: types: [published] - Automatically runs when a GitHub Release is published
  • workflow_dispatch with dry_run boolean input (default: true) - Allows manual testing without publishing

Steps:

  1. Checkout the release tag (or current ref for workflow_dispatch)
  2. Set up Python 3.11 and install PlatformIO
  3. Verify versions:
    • Check library.json and library.properties versions match (fails if they don't)
    • For release events or tag refs: verify tag (e.g., v1.45) matches version 1.45 in library files
    • For non-tag refs (branches): skip tag check and just print library version
  4. Run offline ESP32 tests (compile only): cd tests && pio test --environment esp32dev --without-uploading --without-testing
  5. Run native HTTP parser tests: cd tests/test_http_parser && pio test -e native
  6. Pack the library to /tmp/Web3E-package.tar.gz (outside working directory to avoid self-inclusion)
  7. Publish to PlatformIO Registry: pio pkg publish /tmp/Web3E-package.tar.gz --type library --owner alphawallet --no-interactive (uses PLATFORMIO_AUTH_TOKEN secret, publishes the already-packed tarball)
  8. Attach tarball to GitHub Release: Uses gh CLI to upload the packed library as a release asset

Dry Run Mode:

  • When dry_run is enabled (manual dispatch), the workflow packs the library and uploads it as a workflow artifact instead of publishing
  • Useful for testing the workflow without actually publishing to the registry

2. Library Package Configuration (library.json)

Added export.exclude to prevent test/dev files from being published:

Excluded:

  • tests/ - Test suite
  • test-consumer/ - Test consumer project
  • tools/ - Development tools
  • .github/ - GitHub workflows
  • docs/ - Documentation folder (README.md is still included at root)
  • Build artifacts and caches (.pio, .platformio)

Included:

  • src/ - Library source code
  • examples/ - Example projects
  • library.json, library.properties, LICENSE, keywords.txt, README.md, RELEASING.md

The packed library contains 90 files (verified locally with pio pkg pack).

3. Release Documentation (RELEASING.md)

Added comprehensive documentation for the release process:

  1. Bump version in library.json and library.properties
  2. Merge PR to master
  3. Create GitHub Release with matching tag (e.g., v1.45 for version 1.45)
  4. Workflow automatically publishes to PlatformIO Registry

Testing

✅ Simulated workflow locally on the branch (non-tag ref):

  • ✅ Version verification passes (library.json 1.45 matches library.properties 1.45)
  • ✅ Tag check skipped for non-tag refs (no false failures on branches)
  • ✅ Offline ESP32 tests compile successfully
  • ✅ Native HTTP parser tests pass (12/12 tests)
  • ✅ Library packs to /tmp/Web3E-package.tar.gz (90 files)
  • ✅ All exclusions work: no tests/, tools/, .github/, test-consumer/, or *.tar.gz in package
  • ✅ Source code, examples, and metadata properly included

Permissions

The workflow requires:

  • contents: write - To attach tarball to GitHub Release
  • PLATFORMIO_AUTH_TOKEN secret - Already configured by Rob for publishing

Next Steps

After this PR is merged, the release workflow will be ready to use. To publish version 1.45 (or future versions):

  1. Create a GitHub Release with tag v1.45 targeting master
  2. The workflow will automatically run and publish to the PlatformIO Registry
  3. The packed tarball will be attached to the GitHub Release
Open in Web Open in Cursor 

cursoragent and others added 2 commits November 16, 2026 05:38
- Add release.yml workflow that publishes to PlatformIO Registry
- Trigger on release publish and manual workflow_dispatch (dry_run option)
- Verify tag matches library.json version before publishing
- Run offline tests (esp32dev) and native HTTP parser tests
- Pack library and attach tarball to GitHub Release
- Add export.exclude to library.json to exclude test/dev files
- Add RELEASING.md documenting the release process

Co-authored-by: James Brown <JamesSmartCell@users.noreply.github.com>
1. Fix dry run version check: skip tag comparison for non-tag refs
2. Add library.json vs library.properties version comparison
3. Pack tarball to /tmp to avoid including it in working directory
4. Publish the already-packed tarball instead of re-packing

Co-authored-by: James Brown <JamesSmartCell@users.noreply.github.com>
@JamesSmartCell
JamesSmartCell merged commit 9224859 into master Nov 16, 2026
7 checks passed
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.

2 participants