Skip to content

Commit

Permalink
Update release workflow.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrstegeman committed Nov 29, 2020
1 parent 9d52278 commit 4950657
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
19 changes: 16 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 }}
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down

0 comments on commit 4950657

Please # to comment.