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, Create 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 release)release_type
(e.g., major, minor, patch)
- Initialize Release Template
- Purpose: Creates 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.
- Required Parameters (these are hardcoded in the template):
branch
(The head ref for the release PR)node-version
(The node version used to build the artifacts)asset-paths
(The glob path used to get all the release artifacts)
- Create 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 PR)release-store
(The head ref for the release PR)
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
,create-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": "echo \"Place holder for build command\" && mkdir out && echo \"Hello World!\" > hello.txt" },
-
Build Artifacts Paths:
- The
package
script name and place all artifacts in a way that theasset_paths
set in Create 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
- Create 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 the release CI fails and does not recover automatically, follow these steps to reset the release process:
-
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
How would the command line work in each repository? The repos won't have the Reusable CI scripts.