Skip to content

Latest commit

 

History

History
39 lines (28 loc) · 3.36 KB

RELEASE.md

File metadata and controls

39 lines (28 loc) · 3.36 KB

Release Process

  1. Merge all PRs intended for the release.
  2. Ensure any relevant FIXME notes in the code are addressed (e.g. FIXME: remove this feature before next major release).
  3. Rebase latest remote main branch locally (git pull --rebase origin main).
  4. Ensure all analysis checks and tests are passing (time TEST_COMPUTE_INIT=1 TEST_COMPUTE_BUILD=1 TEST_COMPUTE_DEPLOY=1 make all).
  5. Ensure goreleaser builds locally (make release GORELEASER_ARGS="--snapshot --skip=validate --skip=post-hooks --clean").
  6. Open a new PR to update CHANGELOG (example)1.
  7. Merge CHANGELOG.
  8. Rebase latest remote main branch locally (git pull --rebase origin main).
  9. Tag a new release (tag=vX.Y.Z && git tag -s $tag -m $tag && git push $(git config branch.$(git symbolic-ref -q --short HEAD).remote) $tag)2.
  10. Copy/paste CHANGELOG into the draft release.
  11. Publish draft release.

Creation of npm packages

Each release of the Fastly CLI triggers a workflow in .github/workflows/publish_release.yml that results in the creation of a new version of the @fastly/cli npm package, as well as multiple packages each representing a supported platform/arch combo (e.g. @fastly/cli-darwin-arm64). These packages are given the same version number as the Fastly CLI release. The workflow then publishes the @fastly/cli package and the per-platform/arch packages to npmjs.com using the NPM_TOKEN secret in this repository. The per-platform/arch packages are generated on each release and not committed to source control.

Note

The workflow step that performs npm version in the directory of the @fastly/cli package triggers the execution of the version script listed in its package.json. In turn, this script creates the per-platform/arch packages.

The @fastly/cli package is set up to declare the platform/arch-specific packages as optionalDependencies. When a package installs @fastly/cli as one of its dependencies, npm will additionally install just the platform/arch-specific package compatible with the environment.

Note

The optionalDependencies list only restricts the packages that are actually installed into the node_modules directory in an environment, and does not affect what is saved to the lockfile (package-lock.json). All the platform/arch-specific packages will be listed in the lockfile, so a single lockfile is safe to use in environments that may represent a different platform/arch combo.

To see an example of the module layout, run:

npm install @fastly/cli-darwin-arm64 --verbose
ls node_modules/@fastly/cli-darwin-arm64

You should see a fastly executable binary as well as an index.js shim which allows the package to be imported as a module by other JavaScript projects.

Footnotes

  1. We utilize semantic versioning and only include relevant/significant changes within the CHANGELOG (be sure to document changes to the app config if config_version has changed, and if any breaking interface changes are made to the fastly.toml manifest those should be documented on https://fastly.com/documentation/developers).
  2. Triggers a github action that produces a 'draft' release.