From 1a5818238eaf193823903f8824959693c0dbfd7e Mon Sep 17 00:00:00 2001 From: Giles Roadnight <10414642+Roaders@users.noreply.github.com> Date: Wed, 18 May 2022 07:29:19 +0100 Subject: [PATCH] Update release process --- .github/workflows/build.yml | 2 +- .github/workflows/create-release.yaml | 38 +++++++++++++++++++++++++++ .github/workflows/release.yml | 25 ------------------ package.json | 1 - 4 files changed, 39 insertions(+), 27 deletions(-) create mode 100644 .github/workflows/create-release.yaml delete mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9c660d0..5ecfd36 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,7 +14,7 @@ jobs: strategy: matrix: - node-version: [10.x, 12.x, 14.x] + node-version: [10.x, 12.x, 14.x, 16.x] steps: - uses: actions/checkout@v2 diff --git a/.github/workflows/create-release.yaml b/.github/workflows/create-release.yaml new file mode 100644 index 0000000..716b687 --- /dev/null +++ b/.github/workflows/create-release.yaml @@ -0,0 +1,38 @@ +name: Create Release +on: + push: + branches: + - main + +jobs: + build: + name: Create Release + runs-on: ubuntu-latest + steps: + + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Setup Node + uses: actions/setup-node@v2 + with: + node-version: '16.x' + + - name: Install node modules and verify build + run: npm ci && npm run build-release + + - name: Release + uses: justincy/github-action-npm-release@2.0.2 + id: release + + - name: Print release output + if: ${{ steps.release.outputs.released == 'true' }} + run: echo Release ID ${{ steps.release.outputs.release_id }} + + - name: Publish + if: steps.release.outputs.released == 'true' + uses: JS-DevTools/npm-publish@v1 + with: + token: ${{ secrets.NPM_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 2baa6ca..0000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: NPM Publish -on: - release: - types: [published] -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - # Setup .npmrc file to publish to npm - - uses: actions/setup-node@v2 - with: - node-version: '14.x' - registry-url: 'https://registry.npmjs.org' - - run: npm ci - - run: npm publish --access public - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - - uses: JamesIves/github-pages-deploy-action@4.1.5 - with: - branch: gh-pages - folder: docs - - uses: codecov/codecov-action@v2 - with: - token: ${{ secrets.CODECOV_TOKEN }} \ No newline at end of file diff --git a/package.json b/package.json index 2b40f42..21df7ac 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,6 @@ "watch-test:jest": "jest --watch", "copy-dist": "concurrently --kill-others-on-fail npm:copy-dist-*", "watch-test-coverage": "karma start", - "prepublishOnly": "npm run build-release", "lint:fix": "eslint . --ext .ts,.js --fix" }, "devDependencies": {