Skip to content

Commit

Permalink
ci: update GH workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
denysdovhan committed Feb 21, 2022
1 parent 56e0604 commit 1dd7bec
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 26 deletions.
14 changes: 0 additions & 14 deletions .github/workflows/build.yml

This file was deleted.

30 changes: 21 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,31 @@ on:
push:
branches:
- master

jobs:
release:
name: Prepare release
name: Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build the file
run: |
cd /home/runner/work/vacuum-card/vacuum-card
npm install
npm run lint
npm run build
- name: Release
- name: 🛑 Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.9.1

- name: ⬇️ Checkout Repo
uses: actions/checkout@v2

- name: ⬢ Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '*'
cache: npm

- name: 📦 Install Packages
run: npm ci

- name: 🏗 Build
run: npm run build

- name: 🚀 Release
run: npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
32 changes: 32 additions & 0 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Validate
on:
push:
pull_request:

jobs:
validate:
name: Validate
runs-on: ubuntu-latest
steps:
- name: 🛑 Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.9.1

- name: ⬇️ Checkout Repo
uses: actions/checkout@v2

- name: ⬢ Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '*'
cache: npm

- name: 📦 Install Packages
run: npm ci

- name: 🧪 Test
run: npm test

- name: 👷 HACS validation
uses: hacs/action@main
with:
category: plugin
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@
"description": "Vacuum cleaner card for Home Assistant Lovelace UI",
"main": "dist/vacuum-card.js",
"scripts": {
"postpublish": "git push --follow-tags",
"start": "rollup -c --watch",
"compile": "rollup -c",
"lint": "eslint src",
"lint:fix": "eslint src --fix",
"format": "prettier --write .",
"build": "npm run lint && npm run compile"
"build": "rollup -c",
"test": "npm run lint && npm run build"
},
"keywords": [
"home-assistant",
Expand Down

0 comments on commit 1dd7bec

Please sign in to comment.