From 32bbd8903c308d069f0d8f86ceaede83f165e66e Mon Sep 17 00:00:00 2001 From: James Oliver Date: Mon, 13 Jun 2022 16:03:30 +0100 Subject: [PATCH 1/4] ci: enables dependency caching --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c06f264..5c48229 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -49,7 +49,7 @@ jobs: uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} -# cache: npm # Currently broken + cache: npm - name: Install Dependencies run: npm ci - name: ESLint From e32285d1baedbb90759a59362ea16caf8266d796 Mon Sep 17 00:00:00 2001 From: James Oliver Date: Mon, 13 Jun 2022 16:07:32 +0100 Subject: [PATCH 2/4] fix: adds fix for git revisions --- .github/workflows/build.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5c48229..c1db5e9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -45,6 +45,8 @@ jobs: steps: - name: Checkout Repository uses: actions/checkout@v3 + with: + fetch-depth: 0 - name: Setup Node ${{ matrix.node-version }} uses: actions/setup-node@v3 with: From c77c0e009f3e43c16e19f6541ca2eb7821c4f634 Mon Sep 17 00:00:00 2001 From: James Oliver Date: Mon, 13 Jun 2022 16:42:27 +0100 Subject: [PATCH 3/4] feat: adds release workflow --- .github/workflows/release.yml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..21dce04 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,33 @@ +name: Release + +on: + release: + types: [ created ] + +jobs: + npm: + name: npm + runs-on: ubuntu-latest + + steps: + - name: Checkout Repository + uses: actions/checkout@v3 + - name: Setup Git + run: | + git config --global user.name GitHub Actions + git config --global user.email J-R-Oliver@users.noreply.github.com + - name: Setup Node + uses: actions/setup-node@v3 + with: + node-version: 16.x + registry-url: https://registry.npmjs.org + - name: Install Dependencies + run: npm ci + - name: Generate Changelog + run: npx standard-version --first-release + - name: Publish + run: npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + - name: Commit Changelog + run: git push From 52abd394df50bd11f9c547a0a42b4cc4a7666801 Mon Sep 17 00:00:00 2001 From: James Oliver Date: Mon, 13 Jun 2022 16:46:28 +0100 Subject: [PATCH 4/4] docs: adds release workflow details --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index 780ee2c..59974ff 100644 --- a/README.md +++ b/README.md @@ -161,3 +161,12 @@ This job automates tasks relating to repository linting and enforcing best pract #### Node This job automates `Node.js` specific tasks. + +### Release Workflow + +The [release](./.github/workflows/release.yml) workflow handles release tasks. This workflow consists of one job, `npm`. + +#### npm + +This job automates tasks relating to updating [changelog](./CHANGELOG.md), tagging and publishing to ( +npm)(https://www.npmjs.com).