50 lines
1.3 KiB
YAML
50 lines
1.3 KiB
YAML
name: Build homebridge-hue-chase
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
branches:
|
|
- master
|
|
|
|
jobs:
|
|
build:
|
|
name: Build
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 18
|
|
- run: |
|
|
npm ci
|
|
npm run build
|
|
|
|
version:
|
|
name: Version
|
|
outputs:
|
|
version: ${{ steps.get_version.outputs.version }}
|
|
commit: ${{ steps.get_commit.outputs.commit }}
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 18
|
|
- id: get_version
|
|
run: echo version=$(node -p "require('./package.json').version") >> "$GITHUB_OUTPUT"
|
|
- id: get_commit
|
|
run: echo "commit=$(echo $DRONE_COMMIT | cut -c1-5)" >> "$GITHUB_OUTPUT"
|
|
|
|
|
|
publish_tagged:
|
|
name: Publish Latest
|
|
needs: version
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-node@v4
|
|
- run: npm config set @watsonb8:registry https://gitea.watsonlabs.net/api/packages/watsonb8/npm/
|
|
- env:
|
|
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
run: npm config set -- '//gitea.watsonlabs.net/api/packages/watsonb8/npm/:_authToken' "$NPM_TOKEN"
|
|
- run: npm publish
|
|
|
|
# deploy:
|
|
# name: Deploy Package
|