From 49506574b21a8c9c729688d151affd840a609690 Mon Sep 17 00:00:00 2001 From: Michael Stegeman Date: Sat, 28 Nov 2020 22:04:33 -0900 Subject: [PATCH] Update release workflow. --- .github/workflows/release.yml | 19 ++++++++++++++++--- package.json | 5 ++--- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 11a9a79..fbb09c7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,11 +10,15 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + - uses: actions/setup-node@v1 with: node-version: 10 + registry-url: 'https://registry.npmjs.org' + - name: Set release version run: echo "RELEASE_VERSION=${GITHUB_REF:11}" >> $GITHUB_ENV + - name: Create Release id: create_release uses: actions/create-release@v1.0.0 @@ -25,7 +29,16 @@ jobs: release_name: Release ${{ env.RELEASE_VERSION }} draft: false prerelease: false + + - name: Build project + run: | + npm ci + npm run lint + npm run build + env: + CI: true + - name: Publish to npm - uses: JS-DevTools/npm-publish@v1 - with: - token: ${{ secrets.NPM_TOKEN }} + run: npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/package.json b/package.json index 0b712d4..9eff61b 100644 --- a/package.json +++ b/package.json @@ -3,9 +3,8 @@ "version": "1.0.0", "description": "Bindings for WebThings Gateway add-ons", "scripts": { - "prepare": "if [ ! -d schema/messages ]; then git submodule init; git submodule update; fi; npm run build", - "lint": "eslint src --ext .ts", - "build": "node generate-types.js && tsc -p ." + "build": "if [ ! -d schema/messages ]; then git submodule init; fi; git submodule update && node generate-types.js && tsc -p .", + "lint": "eslint src --ext .ts" }, "main": "lib/index.js", "keywords": [