Skip to content

Commit f4455d4

Browse files
authored
Merge pull request #4 from J-R-Oliver/3-add-release-workflow
3 add release workflow
2 parents 7c3ff0e + 52abd39 commit f4455d4

3 files changed

Lines changed: 45 additions & 1 deletion

File tree

.github/workflows/build.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,13 @@ jobs:
4545
steps:
4646
- name: Checkout Repository
4747
uses: actions/checkout@v3
48+
with:
49+
fetch-depth: 0
4850
- name: Setup Node ${{ matrix.node-version }}
4951
uses: actions/setup-node@v3
5052
with:
5153
node-version: ${{ matrix.node-version }}
52-
# cache: npm # Currently broken
54+
cache: npm
5355
- name: Install Dependencies
5456
run: npm ci
5557
- name: ESLint

.github/workflows/release.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Release
2+
3+
on:
4+
release:
5+
types: [ created ]
6+
7+
jobs:
8+
npm:
9+
name: npm
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout Repository
14+
uses: actions/checkout@v3
15+
- name: Setup Git
16+
run: |
17+
git config --global user.name GitHub Actions
18+
git config --global user.email J-R-Oliver@users.noreply.github.com
19+
- name: Setup Node
20+
uses: actions/setup-node@v3
21+
with:
22+
node-version: 16.x
23+
registry-url: https://registry.npmjs.org
24+
- name: Install Dependencies
25+
run: npm ci
26+
- name: Generate Changelog
27+
run: npx standard-version --first-release
28+
- name: Publish
29+
run: npm publish
30+
env:
31+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
32+
- name: Commit Changelog
33+
run: git push

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,3 +161,12 @@ This job automates tasks relating to repository linting and enforcing best pract
161161
#### Node
162162

163163
This job automates `Node.js` specific tasks.
164+
165+
### Release Workflow
166+
167+
The [release](./.github/workflows/release.yml) workflow handles release tasks. This workflow consists of one job, `npm`.
168+
169+
#### npm
170+
171+
This job automates tasks relating to updating [changelog](./CHANGELOG.md), tagging and publishing to (
172+
npm)(https://www.npmjs.com).

0 commit comments

Comments
 (0)