diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c06f264..c1db5e9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -45,11 +45,13 @@ 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: node-version: ${{ matrix.node-version }} -# cache: npm # Currently broken + cache: npm - name: Install Dependencies run: npm ci - name: ESLint 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 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).