Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
tkrofta committed Feb 27, 2021
2 parents 1a38ca3 + 1e27d3b commit 79c985a
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 1 deletion.
61 changes: 61 additions & 0 deletions .github/workflows/npm-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# NPM Release
name: npm-release

# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [ main ]

jobs:
publish:
name: Check release to NPM
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Check if version has been updated
id: check
uses: EndBug/version-check@v1
with:
file-url: https://unpkg.com/openweather-signalk@latest/package.json
static-checking: localIsNew

- name: Log when unchanged
if: steps.check.outputs.changed == 'false'
run: 'echo "Non release change"'

- name: Log when changed
if: steps.check.outputs.changed == 'true'
run: 'echo "Version changed commit ${{ steps.check.outputs.commit }}! New version: ${{ steps.check.outputs.version }} (${{ steps.check.outputs.type }})"'

- name: Create Release
if: steps.check.outputs.changed == 'true'
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ steps.check.outputs.version }}
release_name: Release ${{ steps.check.outputs.version }} (${{ steps.check.outputs.type }})
body: |
New release to NPM
- Tagged to ${{ steps.check.outputs.version }}
- Release ${{ steps.check.outputs.version }} (${{ steps.check.outputs.type }})
draft: false
prerelease: false

- name: Setup Node
if: steps.check.outputs.changed == 'true'
uses: actions/setup-node@v1
with:
node-version: 14
registry-url: https://registry.npmjs.org/
- name: Install Package
if: steps.check.outputs.changed == 'true'
run: yarn install
- name: Publish Package
if: steps.check.outputs.changed == 'true'
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_AUTH_TOKEN}}
4 changes: 4 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#vscode
.vscode
#github
.github
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ Note: Alerts from openweathermap.org currently not implemented as based on <code
uvindex: 0,
clouds: 100,
visibility: 10000,
wind: { speed: 3.47, dir: 233 }
wind: { speed: 3.47, dir: 4.665 }
}
</code></p>

The plugin shall adhere to meta-data units according to the SignalK definition.

0 comments on commit 79c985a

Please sign in to comment.