RELEASE_PROCESS.md
This document describes our complete release process—from version bumping and testing to deployment.
Note: Although we publish to npm as part of the process, installing the serverless CLI does not require a npm package. Users can install it using:
bashcurl -o- -L https://install.serverless.com | bashThis ensures that the newly released version is available without requiring npm publishing.
Our release process involves updating two separate package.json files, running tests via our CI/CD pipeline, and executing multiple deployment jobs.
The process is automated through GitHub Actions and consists of tagging, building, publishing artifacts to S3, updating our release metadata in MongoDB, and publishing to npm.
The GitHub Actions configuration is structured into several jobs:
Integration Tests (test-matrix):
Runs integration tests across multiple platforms (Linux, Windows, ARM) using a matrix strategy.
Tag New Version: Tags the repository with the new version if changes are detected, then pushes the tag.
Publish New Version: Executes steps to install dependencies, build the project, prepare release tarballs (including copying additional files), upload artifacts, and update metadata in MongoDB.
Build and Publish npm Package: Focuses on publishing the installer package to npm after the release has been prepared.
Files to update:
packages/sf-core-installer/package.jsonpackages/sf-core/package.jsonProcedure:
Update the version in both files. Then, create a pull request (PR) with the title: chore: release x.x.x where x.x.x is the new version number.
Trigger:
Once the PR is merged into the main branch, our GitHub Actions pipeline (.github/workflows/release-framework.yml) is triggered.
Testing:
test-engine job to verify the engine package functionality.test-matrix job which executes integration tests across multiple platforms (Linux, Windows, ARM).Conditional Release Jobs: If all tests pass, the release process continues with the following jobs.
Job: release-canary
Steps:
prepareReleaseTars.sh with IS_CANARY=true environment variable.releases.json file.install.serverless-dev.com).package.json with the previous one.[email protected].Outcome:
Job: release-stable
Condition: Only runs if a new version was detected in the previous job.
Steps:
prepareReleaseTars.sh without the IS_CANARY flag.package.json.releases.json and versions.json files.prepareDistributionTarballs.js to copy additional files required for the final archive.
npm pack.install.serverless.com).RELEASES_MONGO_URI secret.
releases collection.release-metadata collection to add the new supported version.E3OEL4OJF1G5FG)./releases.json and /versions.json to ensure the latest version information is available.Outcome:
Job: release-npm
Dependency: Only runs after the release-stable job completes successfully.
Steps:
README.md from the serverless package to the installer package.npm publish command.NPM_PUBLISH_TOKEN secret for authentication.Outcome:
Canary releases are an important part of our deployment strategy, allowing us to test new versions with a limited audience before full deployment.
Purpose:
Implementation:
https://install.serverless-dev.com) from production releases (https://install.serverless.com).release-canary job in our CI/CD pipeline handles the canary release process.Technical Implementation Details:
Release Workflow (.github/workflows/release-framework.yml):
release-canary that runs after integration tests pass.IS_CANARY environment variable to true when preparing release tarballs.Release Preparation (packages/sf-core/prepareReleaseTars.sh):
IS_CANARY=true, the script:
install.serverless-dev.com as the S3 bucket instead of install.serverless.com.canary-{git-sha}.tgz and canary.tgz (the latter allows users to always get the latest canary).Version Management (packages/sf-core/scripts/updateReleasesJson.cjs and prepareDistributionTarballs.js):
IS_CANARY environment variable.package.json.releases.json file is updated with the Git SHA as the version.Users can opt into using canary releases in two ways:
Use the latest canary release:
Specify canary as the framework version in your serverless.yml file:
frameworkVersion: canary
This will automatically use the most recent canary version available by downloading canary.tgz.
Use a specific canary release:
Specify a specific canary version in your serverless.yml file:
frameworkVersion: canary-{git-sha}
Replace {git-sha} with the specific Git SHA of the canary version you want to use.
When a canary version is specified, the system will:
https://install.serverless-dev.com).The complete canary release process works as follows:
main branch, triggering the integration workflow.release-canary job executes with IS_CANARY=true.git rev-parse --short HEAD.releases.json from the canary S3 bucket.releases.json with the Git SHA as the version.framework-dist directory.framework-dist/package.json to match the Git SHA.npm pack to create the tarball.canary-{git-sha}.tgz and canary.tgz.releases.json to the canary S3 bucket.main.release-stable job.package.json (not the Git SHA).install.serverless.com).publish:release and publish:release-metadata scripts.sf-core-installer@{version} and pushes the tag.This makes the release available to all users, not just those who explicitly opt into the canary channel.