This repository holds reusable and template workflows for the new release system.
- Overview
- Workflow Templates
- Shared CI
- Repository Setup
- Recovering from a Failed Release CI
- Command Line
The CI flow consists of three key steps: Initialize Release, Make Release Artifacts, and Publish Release. These workflows ensure a structured process for versioning, creating artifacts, and publishing new releases.
Each workflow step has an associated template to set up workflow triggers and call the reusable workflows from the Shared CI.
- Hook into repository workflow triggers.
- Call reusable workflows in the Shared CI.
- Standardize workflow execution across repositories.
- Purpose: Prepares a new release by incrementing the version and creating a release branch.
- Triggers: Manual dispatch with required parameters.
- Actions:
- Increment the version number.
- Create and checkout a new branch (
release/version
). - Commit the updated version number.
- Update and commit the changelog.
- Open a draft GitHub release.
- Create a pull request for review. Note, this new pull request will trigger the next step.
- Required Parameters:
branch
target branch for the releaserelease_type
e.g., major, minor, patch, prereleasecustomVersion
Ignorerelease_type
and use this specified versioninstallDependencies
Automatically install other RokuCommunity dependencies
- Initialize Release Template
- Purpose: Makes the release artifacts, and upload them.
- Triggers: Pushes and updates to
release/*
branches. - Actions:
- Build the release artifacts.
- Upload artifacts to the draft GitHub release.
- Sets the GitHub Release body equal to the changes in the ChangeLog
- Required Parameters (these are hardcoded in the template):
branch
The head ref for the release PRnode-version
The node version used to build the artifacts. If needed edit the template when you add it to your projectasset-paths
The glob path used to get all the release artifacts
- Make Release Artifacts Release Template
- Purpose: Finalizes the release by marking it as non-draft and publishing the code.
- Triggers: Merging of a
release/*
branch. - Actions:
- Mark the GitHub release as non-draft.
- Publish the release to users (e.g., npm, VS Code Marketplace).
- Publish Release Template
- Required Parameters (these are hardcoded in the template):
branch
The head ref for the release PRrelease-store
The head ref for the release PR. If needed, specify what release store you are publishing to
To integrate this release workflow system into a new repository, follow these steps:
-
Add Workflow Templates: Each repository must include the workflow templates:
initialize-release
,make-release-artifacts
,publish-release
from this repository. More details in this section: Setting Up Template Workflows in a Repository -
Ensure Required NPM Script Exist:
package
: Compiles the application.
Example
package.json
"scripts": { "package": "npm run build && npm pack" },
-
Build Artifacts Paths:
- The
package
script name and place all artifacts in a way that theasset-paths
set in Make Release Artifacts Release Template is selectable. - The post-build step will look for release artifacts in this directory to upload to the GitHub release.
- The
To integrate the release workflow system into a repository, follow these steps to add the required workflow templates from the RokuCommunity organization:
- Navigate to your repository on GitHub.
- Click on the Actions tab.
- Click New workflow or go directly to
.github/workflows
. - Under "Choose a workflow", find the By RokuCommunity templates:
- Initialize Release
- Make Release Artifacts
- Publish Release
- Click on each template and select "Configure".
- Edit
asset-paths
if needed - Edit
node-version
if needed - Edit
publish-store
if needed
- Click Commit changes....
- Ensure the commit is made to the default branch (master)
- Click Commit changes
Once these workflows are set up, your repository will automatically follow the structured release process!
If a workflow fails, rerunning the workflow is safe to do and may solve the problem.
If you want to cleanup an inflight release, the best way is to close the release branch that was create. If there was no release branch create, then there is nothing to cleanup.
Closing the release branch will do these 3 steps: delete the GitHub Release, delete the pull request for the release, delete the release branch. You can do these steps manaully by following the instructions below:
-
Delete the GitHub Release
- Go to the Releases section of your repository.
- Find the failed release.
- Click Delete release.
-
Delete the Pull Request for the Release
- Navigate to the Pull Requests tab.
- Locate the pull request associated with the release.
- Close and delete the pull request.
-
Delete the Release Branch
- Go to the Branches section of your repository.
- Find the branch created for the release (e.g.,
release/version
). - Delete the branch.
Note there is a workflow template: Delete Release that does all three steps