Skip to content

Commit 11dd94b

Browse files
authored
Update release process description in readme and add hotfix release action (#472)
1 parent 21bb76d commit 11dd94b

File tree

5 files changed

+92
-74
lines changed

5 files changed

+92
-74
lines changed

.github/workflows/create-new-release.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
name: "Create new release"
22

3-
on:
4-
workflow_dispatch:
5-
inputs:
6-
version:
7-
description: 'The version you want to release.'
8-
required: true
3+
on: workflow_dispatch
94

105
jobs:
116
create-new-release:
@@ -16,6 +11,8 @@ jobs:
1611
steps:
1712
- uses: actions/checkout@v2
1813
- uses: actions/setup-node@v1
14+
with:
15+
node-version: '14.17.4'
1916
- run: npm config set "@fortawesome:registry" https://npm.fontawesome.com/ &&
2017
npm config set "//npm.fontawesome.com/:_authToken" $FONTAWESOME_NPM_AUTH_TOKEN
2118
- run: yarn install
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: "Prepare hotfix"
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: 'The version you want to release.'
8+
required: true
9+
10+
jobs:
11+
prepare-hotfix:
12+
name: Prepare hotfix
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v2
16+
with:
17+
fetch-depth: 0
18+
- uses: actions/setup-node@v1
19+
with:
20+
node-version: '14.17.4'
21+
22+
- name: Create hotfix branch
23+
run: git checkout -b hotfix/${{ github.event.inputs.version }}
24+
25+
- name: Initialize mandatory git config
26+
uses: fregante/setup-git-user@v1
27+
28+
- name: Bump version in package.json
29+
run: yarn version --new-version ${{ github.event.inputs.version }} --no-git-tag-version
30+
31+
- name: Commit manifest files
32+
id: make-commit
33+
run: |
34+
git add package.json
35+
git commit --message "Prepare hotfix ${{ github.event.inputs.version }}"
36+
37+
echo "::set-output name=commit::$(git rev-parse HEAD)"
38+
39+
- name: Publish hotfix branch
40+
run: git push origin hotfix/${{ github.event.inputs.version }}
41+
42+
- name: Merge hotfix into main branch
43+
uses: thomaseizinger/[email protected]
44+
env:
45+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
46+
with:
47+
head: hotfix/${{ github.event.inputs.version }}
48+
base: main
49+
title: Merge hotfix/${{ github.event.inputs.version }} into main branch
50+
51+
- name: Merge hotfix into develop branch
52+
uses: thomaseizinger/[email protected]
53+
env:
54+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
55+
with:
56+
head: hotfix/${{ github.event.inputs.version }}
57+
base: develop
58+
title: Merge hotfix/${{ github.event.inputs.version }} into develop branch
59+

.github/workflows/prepare-release.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,16 @@ on:
88
required: true
99

1010
jobs:
11-
create-new-release:
12-
name: Create new release
11+
prepare-release:
12+
name: Prepare release
1313
runs-on: ubuntu-latest
1414
steps:
1515
- uses: actions/checkout@v2
1616
with:
1717
fetch-depth: 0
1818
- uses: actions/setup-node@v1
19+
with:
20+
node-version: '14.17.4'
1921

2022
- name: Create release branch
2123
run: git checkout -b release/${{ github.event.inputs.version }}

.github/workflows/release.yml

Lines changed: 0 additions & 64 deletions
This file was deleted.

README.md

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,33 @@ Once your pull request has been approved by all parties, you may begin the merge
143143
* Run `yarn test` to ensure tests are passing.
144144
* Click the Squash and merge button on your pull request and edit your commit message to a concise description of your changes.
145145

146-
## Release steps
146+
## Release process
147147

148-
This package uses [Semantic versioning](https://semver.org/), which requires version numbers in MAJOR.MINOR.PATCH format. Any breaking changes to the API require an update to the MAJOR version. Backwards compatible changes only require an update to the MINOR version. Hotfixes and patches need only update the PATCH version. Once you have commits ready to bundle you may begin the release process:
148+
This repository follows the [git flow release process](https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow).
149+
* Each new feature branch uses develop as its parent branch and is merged back into develop upon completion.
150+
* Each new hotfix branch uses main as its parent branch and is merged directly into main.
151+
152+
This package uses [Semantic versioning](https://semver.org/), which requires version numbers in MAJOR.MINOR.PATCH format. Any breaking changes to the API require an update to the MAJOR version. Backwards compatible changes only require an update to the MINOR version. Hotfixes and patches need only update the PATCH version.
153+
154+
To create a new release off of the current develop:
155+
* Run the "Prepare release" github action which will
156+
* Create a new release branch off of the latest develop and increment package.json
157+
* Create a pull request of the release branch against main
158+
* Create a pull request of the release branch against develop
159+
* From there the developer can merge the PRs via github
160+
* Run the "Create new release" github action which will build the project and create a new release off of the latest main
161+
162+
To create a patch release for a hotfix off the current main:
163+
* Run the "Prepare hotfix" github action which will
164+
* Create a hotfix off the latest main and increment package.json
165+
* Create a pull request of the hotfix branch against main
166+
* Create a pull request of the release branch against develop
167+
* From there the developer can merge the PRs via github
168+
* Run the "Create new release" github action which will build the project and create a new release off of the latest main
169+
170+
## Manual Release steps
171+
172+
If you are not able to or choose not to use the github actions described above, the following is the process to manually create a new release. Once you have commits ready to bundle you may begin the release process:
149173
* Update the "version" field in package.json.
150174
* Run `yarn build` to compile the source files and write out to the lib directory.
151175
* Run `npm pack` to archive all of the source files. Note: you can run `npm pack --dry-run` to see a list of files that will be included in the package. This is useful to double check a new component is being added or to see the size of the package/individual files.

0 commit comments

Comments
 (0)