From 205f648a650324789acb4b8ed408c102cf112be8 Mon Sep 17 00:00:00 2001 From: Jeff Ching Date: Mon, 1 Mar 2021 17:46:27 -0800 Subject: [PATCH] docs: document configuring multiple release branches (#245) --- README.md | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/README.md b/README.md index f887c28..e68defc 100644 --- a/README.md +++ b/README.md @@ -125,6 +125,46 @@ jobs: changelog-types: '[{"type":"feat","section":"Features","hidden":false},{"type":"fix","section":"Bug Fixes","hidden":false},{"type":"chore","section":"Miscellaneous","hidden":false}]' ``` +### Supporting multiple release branches + +`release-please` has the ability to target not default branches. You can even use separate release strategies (`release-type`). +To configure, simply configure multiple workflows that specify a different `default-branch`: + +Configuration for `main` (default) branch (`.github/workflows/release-main.yaml`): +```yaml +on: + push: + branches: + - main +name: release-please +jobs: + release-please: + runs-on: ubuntu-latest + steps: + - uses: GoogleCloudPlatform/release-please-action@v2 + with: + release-type: node + package-name: release-please-action +``` + +Configuration for `1.x` (default) branch (`.github/workflows/release-1.x.yaml`): +```yaml +on: + push: + branches: + - 1.x +name: release-please +jobs: + release-please: + runs-on: ubuntu-latest + steps: + - uses: GoogleCloudPlatform/release-please-action@v2 + with: + release-type: node + package-name: release-please-action + default-branch: 1.x +``` + ## Automating publication to npm With a few additions, the Release Please action can be made to publish to