Skip to content

Commit 96129ec

Browse files
authored
Merge pull request #60 from simonireilly/main
Perform release automation using github release tags
2 parents 3301620 + 62dae87 commit 96129ec

File tree

2 files changed

+54
-0
lines changed

2 files changed

+54
-0
lines changed

.github/workflows/release.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: CD Build and Publish to NPM
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- uses: actions/checkout@v1
13+
14+
- name: Yarn Install
15+
run: yarn
16+
17+
- name: Lint
18+
run: yarn lint
19+
20+
- name: Jest Tests
21+
run: yarn test:ci
22+
23+
- name: Typescript build
24+
run: yarn build
25+
26+
- name: Set Version to Release Tag Name
27+
run: |
28+
yarn version --new-version ${{ github.event.release.tag_name }} --no-git-tag-version
29+
30+
- name: Publish to npm, publish pre-release as beta
31+
uses: JS-DevTools/npm-publish@v1
32+
with:
33+
token: ${{ secrets.NPM_TOKEN }}
34+
dry-run: true
35+
tag: ${{ github.event.release.prerelease && 'beta' || 'latest' }}

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# NHS.UK React Components
22

3+
- [NHS.UK React Components](#nhsuk-react-components)
4+
- [Coming from 0.x?](#coming-from-0x)
5+
- [Installation](#installation)
6+
- [Usage](#usage)
7+
- [Storybook](#storybook)
8+
- [Maintainers](#maintainers)
9+
- [Preparing Releases](#preparing-releases)
10+
311
NHS.UK Frontend ported to React
412

513
[![GitHub Actions CI Status](https://github.com/NHSDigital/nhsuk-react-components/workflows/CI/badge.svg)](https://github.com/NHSDigital/nhsuk-react-components/actions?query=workflow%3A%22CI+Build%22+branch%3Amain) [![Bundle Size](https://img.shields.io/bundlephobia/minzip/nhsuk-react-components.svg)](https://bundlephobia.com/result?p=nhsuk-react-components)
@@ -47,3 +55,14 @@ A storybook containing all of the components and their usage can be found [here]
4755
- Thomas Judd-Cooper ([GitHub](https://github.com/tomdango))
4856
- Sam Brown ([GitHub](https://github.com/samueldavidbrown))
4957
- Luke Pearson ([GitHub](https://github.com/lukepearson))
58+
59+
### Preparing Releases
60+
61+
Releases run in CI using github actions.
62+
63+
To prepare a release create a new release TAG in github with your release version.
64+
65+
>`NPM_TOKEN` should be stored in the repositories [secrets in GitHub](https://github.com/NHSDigital/nhsuk-react-components/settings/secrets/actions)
66+
67+
- Create a new release with a tag like `major.minor.patch` against main.
68+
- If the change is a `beta` then select `pre-release` as true, this will make the `tag` point at `beta`. Otherwise the tag will be `latest`.

0 commit comments

Comments
 (0)