Closed zplata closed 1 year ago
LGTM! Sort of a rubber stamp since I haven't followed this runtime flows too much, but the description and the code both look sensible. I guess we're moving away from any type of automated release on JS..?
@umberto-sonnino yep! Probably an interim step right now just to make it consistent across at least the mobile runtimes. Right now it's kind of a funky script that's just automating patch version bumps all around. So this also allows us flexibility to more easily dictate minor/major bumps.
Currently
On every merge to
master
, we auto-publish a bumped patch version on all our web runtime NPM packages (@rive-app
/canvas
,/canvas-advanced
,/canvas-single
,/canvas-advanced-single
,/webgl
,/webgl-advanced
,/webgl-single
,/webgl-advanced-single
) using a combination of shell/node scripts. While this technically works, we should really consider moving to a model similar to other Rive runtimes where we publish on demand by manually triggering a Github Workflow that lets us determine to publish/release apatch
,minor
, ormajor
version. This would allow us to publish on our own terms, and prevent releases we don't really need (i.e docs updates). And allow us to really do major/minor semver releases without manual intervention.Proposal
With this proposed PR and model, we use the release-it tool to coordinate package.json bumps, running scripts at the appropriate time, creating Git tags, npm publishes, committing and pushing back to
master
, and eventually, auto-generatingCHANGELOG.md
blocks. This is currently used in the React, iOS, and Android runtimes.Idea:
publish
Github Action workflow dispatch, choosing eithermajor
,minor
, orpatch
(default) bumprelease-it
bumps the mainpackage.json
version in/js
accordingly/js/.release-it.json
in theafter:version:bump
hook:package.json
files version property (npm run copyVersions
)/js/build.sh
script to build all the JS/WASM/types for the runtimes (npm run build:all
). Build relies on the package.json version for each runtime having been bumped already, so this is why we place the build script at this specific point in therelease-it
workflownpm test
)npm run publish:all
) to NPM registryrelease-it
continues its process to add a new Git tag with the new version, commits all untracked files (which should just be the updatedpackage.json
files for each npm package), and commits/pushes the changes and tag to remoteNotes
We don't do a formal Github Release as there's no releasable software to include here (it's available in the distribution via NPM registry) and because we have multiple variants/npm packages of the web runtime, it might be confusing what we include here. A Github Tag might suffice here.
Adding CHANGELOG updates in a subsequent release. We would use the auto-changelog plugin for release-it, as recommended, to add to a CHANGELOG. But because we have no previous tags really, adding the CHANGELOG to this would include every commit over the past 1.5 years, which seems excessive to display for one release and which isn't true. So we can specify to start this CHANGELOG after the first Github Tag release here. Couldn't find a better way to parse out the old stuff here and just include newer commits in the CHANGELOG, so just going with this approach.
Also, not all variants of the web runtime (i.e.
@rive-app/canvas
and@rive-app/webgl
) are on the same version. This aligns it all to use the same version.We don't actually
npm publish
anything from the mainjs/package.json
, or userelease-it
to do the actual registry publish. It's mainly meant for tracking the "source-of-truth" version all the other npm package.json's should use and for running other development/build scripts. You'll note that thejs/.release-it.json
config showspublish: false
undernpm
config to reflect this.