build: create separate release branches for tagged releases on publish (#457)

This commit is contained in:
Eden Zimbelman
2025-06-12 17:46:56 -07:00
committed by GitHub
parent a3c435be3a
commit 82b86fb801
2 changed files with 17 additions and 2 deletions
+2
View File
@@ -60,6 +60,8 @@ As a maintainer, the development you do will be almost entirely off of your fork
`main` is where active development occurs.
`release/vX.Y.Z` has the packaged distribution of a particular version based from the changes on `main`. This is created using a workflow when new releases are published.
When developing, branches should be created off of your fork and not directly off of this repository. If working on a long-running feature and in collaboration with others, a corresponding branch of the same name is permitted. This makes collaboration on a single branch possible, as contributors working on the same feature cannot push commits to others' open Pull Requests.
After a major version increment, there also may be maintenance branches created specifically for supporting older major versions.
+15 -2
View File
@@ -2,7 +2,9 @@ name: Publish
on:
release:
types: [published, edited]
types:
- published
- edited
jobs:
build:
@@ -14,7 +16,8 @@ jobs:
- name: Checkout the current code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
fetch-depth: 0
persist-credentials: true
ref: ${{ github.event.release.tag_name }}
- name: Configure the runtime node
@@ -31,8 +34,18 @@ jobs:
run: npm run build
- name: Distribute the latest tagged release
id: tag
uses: teunmooij/github-versioned-release@3edf649c6e5e5e976d43f2584b15bdc8b4c8f0df # v1.2.1
with:
template: javascript-action
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Create a branch for tagged release
run: |
git fetch origin "$SHA"
git checkout -b "release/$TAG" "$SHA"
git push origin "release/$TAG"
env:
TAG: ${{ github.event.release.tag_name }}
SHA: ${{ steps.tag.outputs.sha }}