ci: add tag-driven release workflow for SDK packages#148
Closed
behnam-oneschema wants to merge 4 commits into
Closed
ci: add tag-driven release workflow for SDK packages#148behnam-oneschema wants to merge 4 commits into
behnam-oneschema wants to merge 4 commits into
Conversation
Adds a minimal, opt-in release automation that keeps the current human-curated versioning and changelog flow but eliminates the need to run `npm publish` from a developer laptop. - .github/workflows/release.yml: tag-driven (`importer-v*` or `filefeeds-v*`) + workflow_dispatch with dry-run. Verifies every package.json in the family matches the tag version, builds, and publishes with `--access public --provenance` in dependency order. Supports OIDC trusted publishing and falls back to `NPM_TOKEN` if present. - .github/workflows/ci.yml: lint + build guardrails on PRs and pushes to main so we never tag a broken commit. - RELEASING.md: release runbook covering the two synced families (importer / filefeeds), tag conventions, and npm auth setup. - README.md: link to RELEASING.md. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds minimal, opt-in release automation (Option A from the prep discussion) so that publishing the SDK packages no longer requires running
npm publishfrom a developer laptop. Versioning and the two hand-curated changelogs stay exactly as they are today.Two release trains, synced within each family
importer@oneschema/importer,@oneschema/react,@oneschema/vue,@oneschema/angularCHANGELOG.mdimporter-vX.Y.Zfilefeeds@oneschema/filefeeds,@oneschema/filefeeds-reactCHANGELOG-filefeeds.mdfilefeeds-vX.Y.ZNew workflows
.github/workflows/release.yml— fires onimporter-v*/filefeeds-v*tag pushes and onworkflow_dispatch. It:family+versionfrom the tag (or from the dispatch inputs).package.jsonin the family matches the tag version; fails fast on mismatch (I tested both the happy-path and the mismatch path locally — see below).yarn install --frozen-lockfile→ per-packageyarn build(incl.ng buildfor Angular).npm publish --access public --provenancein dependency order (core → wrappers). Angular publishes from theng-packagrdist/@oneschema/angularoutput (which ships its own generatedpackage.json)..github/workflows/ci.yml— lint + build on every PR and every push tomain, so we never tag a broken commit.npm auth
Per the earlier decision, primary path is npm OIDC trusted publishing (no secret needed). One-time setup on npmjs.com required per package (see RELEASING.md). If an
NPM_TOKENrepo secret is set, the workflow uses it as a fallback —--provenanceworks in both modes becauseid-token: writeis granted.Explicit non-goals
chore: bump version numberflow, e.g. chore: bump version number #147).npm publish --dry-runoutput to today's published tarballs; file list is unchanged).Review & Testing Checklist for Human
NPM_TOKENsecret) before the first real release. Without this the tag-push will fail onnpm publish.importer-v*,filefeeds-v*) work for your release flow — happy to rename to anything else.importer, version0.7.4, checkdry_run. Confirm it builds all 4 packages and printspublish --dry-runoutput for each. Repeat forfilefeeds/0.5.2.CIworkflow on every PR is too heavy (yarn install + 6 builds + Angular build ≈ a couple of minutes).Things I verified locally
yarn install --frozen-lockfile --ignore-scripts✓yarn buildsucceeds for all 5 rollup packages ✓yarn ng buildfor Angular producespackages/importer-angular/dist/@oneschema/angularwith a validpackage.json✓npm publish --dry-run --access publicfrom each package dir (incl. the Angular dist dir) produces the expected tarball ✓actionlintpasses on both workflow files ✓Notes
@oneschema/importertarball ships a staleoneschema-importer-v0.5.3.tgz,rollup.config.js, and thetest/tree, because nopackage.json#filesfield is set. This is pre-existing and unchanged.importer-angular's workspace-rootpackage.jsonhas"build": "true"(no-op); the real build lives in thengCLI. The workflow callsyarn run ng builddirectly for clarity, but we could wire this into the root script later.Link to Devin session: https://app.devin.ai/sessions/8aeb53a2c3cf4d51b133df9f10757a48
Requested by: @behnam-oneschema