This repository demonstrates how to implement a SOC 2 compliant release workflow using the release-please-action. The workflow automates version management, changelog generation, and GitHub release creation, ensuring a consistent and auditable release process.
The release workflow consists of two main stages:
- Prerelease - Creates release candidates (RC) for testing before final release
- Release - Creates the final release after successful testing
Given all additional testing- and publish-workflows are implemented compliant, and the GitHub repository has properly configured branch protection rules. This template shows an approach which supports SOC 2 compliance by:
- Compatible with protected main branch rule (no direct commits to main)
- Maintaining a clear audit trail of all changes
- Enforcing a consistent release process
- Automating version management
- Providing traceability between code changes and releases
- Enforcing separation of duties between development and release processes
- Creating a controlled environment for testing through prereleases
- Providing evidence of testing before final release
- Generating comprehensive change management documentation
- Supporting access control through PR approval workflows
- Enabling risk assessment through the prerelease process
- Automated Versioning: Automatically increments version numbers based on Conventional Commits
- Changelog Generation: Automatically creates and updates CHANGELOG.md with categorized changes
- GitHub Releases: Creates GitHub releases with appropriate tags
- Version Synchronization: Updates version information across multiple files
- Prerelease Support: Creates release candidates for testing before final release
- Conditional Execution: Runs different jobs based on whether it's a prerelease or final release
.github/prerelease-config.json: Configuration for prerelease stage.github/release-config.json: Configuration for final release stage.github/prerelease-manifest.json: Tracks the prerelease version.github/release-manifest.json: Tracks the release version
- Label Check: Creates the necessary labels for release-please PRs
- Prerelease Preparation: Creates or finalizes a prerelease pull request
- Prerelease Testing: Runs tests before creating the prerelease
- Prerelease Creation: Creates the prerelease and a subsequent release pull request
- Post-Prerelease Steps: Runs any necessary steps after prerelease
- Release Creation: Creates the final release
- Post-Release Steps: Runs any necessary steps after release
In this example the workflow updates version information in:
version.txt: Simple version tracking.github/prerelease-manifest.json: Version manifest for release-pleaselibrary/build.gradle.kts: Version in build configuration (using special markers)
The CHANGELOG.md file is automatically updated based on the changelog-sections configuration in both the prerelease and release configuration files. The current configuration includes:
- Features (from
feat:commits) - Bug Fixes (from
fix:commits) - Code Refactoring (from
refactor:commits) - Miscellaneous Chores (from
chore:commits) - Build System and Dependencies (from
build:commits) - Documentation (from
docs:commits)
Each section can be customized by modifying the changelog-sections array in the configuration files:
"changelog-sections": [
{ "type": "feat", "hidden": false, "section": "Features" },
{ "type": "fix", "hidden": false, "section": "Bug Fixes" },
{ "type": "refactor", "hidden": false, "section": "Code Refactoring" },
{ "type": "chore", "hidden": false, "section": "Miscellaneous Chores" },
{ "type": "build", "hidden": false, "section": "Build System and Dependencies" },
{ "type": "docs", "hidden": false, "section": "Docs" }
]You can add additional commit types, change section titles, or hide specific sections by setting "hidden": true. For more information on this, check the Configuration File Reference section.
- Push changes to the main branch with Conventional Commits
- The workflow automatically creates a prerelease pull request
- When the prerelease PR is merged, a release candidate is created
- After testing, the workflow creates a final release pull request
- When the release PR is merged, the final release is created
The workflow is implemented using GitHub Actions and the release-please-action. It requires:
- GitHub repository permissions for contents, pull-requests, and repository-projects
- Conventional commit messages for proper changelog generation and version bumping
- Configuration files for prerelease and release stages
This section provides details on how to extend and modify the configuration files used by release-please.
-
release-type: Specifies the release strategy. Options include:
simple: Basic generic versioningnode: For Node.js projectspython: For Python projectsjava: For Java projectsmaven: For Maven projectsgo: For Go projectsrust: For Rust projects- And many others (see release-please documentation)
-
prerelease: Boolean flag to indicate if this is a prerelease configuration
-
prerelease-type: The type of prerelease to create (e.g.,
rc,beta,alpha) -
versioning: The versioning strategy to use:
prerelease: For prerelease versioning (adds suffixes like-rc.1)default: Standard semantic versioning
-
changelog-sections: Defines how different commit types are categorized in the changelog:
type: The commit type (from conventional commits)hidden: Whether to hide this section in the changelogsection: The section title in the changelog
-
packages: Defines the package structure for monorepos or single packages:
.: Represents the root packagetype: The package type (e.g.,generic,node,java)extra-files: Additional files to update with version information
-
extra-files: Files to update during version changes:
type: The file type (generic,json,xml, etc.)path: Path to the filejsonpath: For JSON files, the path to the version fieldmarker: For generic files, a marker pattern to identify version strings
"changelog-sections": [
{ "type": "feat", "hidden": false, "section": "Features" },
{ "type": "fix", "hidden": false, "section": "Bug Fixes" },
{ "type": "perf", "hidden": false, "section": "Performance Improvements" },
{ "type": "refactor", "hidden": false, "section": "Code Refactoring" },
{ "type": "test", "hidden": false, "section": "Testing" },
{ "type": "chore", "hidden": true, "section": "Miscellaneous Chores" }
]"extra-files": [
{
"type": "json",
"path": "package.json",
"jsonpath": "$.version"
},
{
"type": "xml",
"path": "pom.xml",
"xpath": "//project/version"
},
{
"type": "generic",
"path": "src/version.py",
"marker": "VERSION = \"${version}\""
}
]"packages": {
"packages/core": {
"component": "core",
"version-file": "version.txt"
},
"packages/ui": {
"component": "ui",
"version-file": "version.txt"
}
}-
Use Consistent Release Types: Choose a release type that matches your project's language and structure.
-
Define Clear Changelog Sections: Customize changelog sections to match your team's commit conventions.
-
Update All Version References: Ensure all files containing version information are included in
extra-files.
For more detailed information, refer to the official documentation: