Skip to content

Commit e74300f

Browse files
committed
docs: releasing
1 parent 857f9b0 commit e74300f

File tree

4 files changed

+85
-2
lines changed

4 files changed

+85
-2
lines changed

.github/labels.yml

+4
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,10 @@
8080
description: No action to be taken or missing information
8181
color: e7034b
8282

83+
- name: status:merged
84+
description: Merged into next, but not into main (or released)
85+
color: e7034b
86+
8387
- name: status:needs-triage
8488
description: Needs verification and minimal reproduction
8589
color: e7034b
+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Continuous Deployment
2+
#
3+
# References:
4+
#
5+
# - https://docs.github.com/en/actions/guides/building-and-testing-nodejs
6+
# - https://jestjs.io/docs/cli#--ci
7+
8+
---
9+
name: Continuous Deployment
10+
on:
11+
release:
12+
types: [published]
13+
jobs:
14+
continuous-deployment:
15+
runs-on: ubuntu-latest
16+
env:
17+
PAT_GPR: ${{ secrets.PAT_GPR }}
18+
steps:
19+
- name: Checkout branch
20+
uses: actions/checkout@v2
21+
- name: Setup Node.js environment
22+
uses: actions/setup-node@v2
23+
with:
24+
always-auth: true
25+
cache: 'yarn'
26+
registry-url: 'https://npm.pkg.github.com'
27+
scope: '@flex-development'
28+
- name: Install dependencies
29+
run: yarn
30+
env:
31+
NODE_AUTH_TOKEN: ${PAT_GPR}
32+
- name: Run test suites
33+
run: TERM=xterm-256color yarn test --ci
34+
- name: Setup .npmrc file [GPR]
35+
uses: actions/setup-node@v2
36+
with:
37+
registry-url: 'https://npm.pkg.github.com'
38+
scope: '@flex-development'
39+
- name: Get release version
40+
uses: actions/github-script@v4
41+
id: v
42+
with:
43+
script: |
44+
core.setOutput('v', github.event.release.tag_name.split('@')[1])
45+
- name: Publish @flex-development/${{ github.event.release.tag_name }}
46+
if: ${{ startsWith(github.event.release.tag_name, 'grease@') }}
47+
run: npm publish packages/grease/build --tag ${{ steps.v.outputs.v }}
48+
env:
49+
NODE_AUTH_TOKEN: ${PAT_GPR}

.versionrc.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
module.exports = {
77
commitAll: true,
88
gitdir: process.env.PROJECT_CWD,
9-
releaseBranchWhitelist: ['main'],
9+
releaseBranchWhitelist: ['release/*'],
1010
skipUnstable: false,
1111
types: [
1212
{ type: 'feat', section: ':sparkles: Features' },

CONTRIBUTING.md

+31-1
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,34 @@ e.g: `merge: P010-1 (#1)`
349349

350350
## Releasing
351351

352-
**TODO**: Update documentation.
352+
This repository is configured to release a new version for a workspace when a
353+
Github Release is published. Any member with push access can create a release.
354+
355+
> Note: Publishing is executed via the
356+
> [Continuous Deployment](./.github/workflows/continous-deployment.yml)
357+
> workflow. This is so invalid or malicious versions cannot be released by any
358+
> maintainer without merging those changes into `main` first.
359+
360+
Before cutting a new release, the following steps must be completed:
361+
362+
- create a new `release/*` branch
363+
- where `*` is `<package.json#name-no-scope>@<version>`. e.g: `[email protected]`
364+
- decide what version bump this release needs (major, minor, patch)
365+
- versioning
366+
- `yarn release:node` (determines [bumps based on commits][17])
367+
- `yarn release:node --release-as major`
368+
- `yarn release:node --release-as minor`
369+
- `yarn release:node --release-as patch`
370+
- a new release will be drafted
371+
- a new pull request is opened from `next` into `main`
372+
- the PR should be titled `release: <tag-prefix>@<x>.<x>.<x>`
373+
- after review, **create a merge commit**: `release: <tag-prefix>@<x>.<x>.<x>`
374+
- after the PR is merged, a maintainer will publish the drafted released to
375+
trigger the Continuous Deployment workflow
376+
- the maintainer who merged the release PR should wait and see if the workflow
377+
successfully publishes the workspace project(s) to the GitHub Package Registry
378+
- all issues labelled `status:merged` released under `<tag-prefix>@<x>.<x>.<x>`
379+
should be closed and have the label `status:released` added
353380

354381
[1]: https://www.atlassian.com/software/jira
355382
[2]: https://yarnpkg.com/getting-started/migration
@@ -366,3 +393,6 @@ e.g: `merge: P010-1 (#1)`
366393
[13]: https://jestjs.io
367394
[14]: https://jestjs.io/docs/api#describeskipname-fn
368395
[15]: https://jestjs.io/docs/api#testskipname-fn
396+
[16]:
397+
https://docs.github.com/en/actions/reference/events-that-trigger-workflows#release
398+
[17]: https://www.conventionalcommits.org/en/v1.0.0

0 commit comments

Comments
 (0)