chore(ci): Update CI with semantic-release
This commit is contained in:
parent
1010a09a77
commit
2d3d690b0f
|
@ -1,3 +0,0 @@
|
||||||
FROM ludeeus/container:monster
|
|
||||||
|
|
||||||
RUN apk add jq
|
|
|
@ -1,16 +1,12 @@
|
||||||
// See https://aka.ms/vscode-remote/devcontainer.json for format details.
|
// See https://aka.ms/vscode-remote/devcontainer.json for format details.
|
||||||
{
|
{
|
||||||
"name": "Button Card Development",
|
"name": "Button Card Development",
|
||||||
"dockerFile": "Dockerfile",
|
"image": "ghcr.io/ludeeus/devcontainer/generic:latest",
|
||||||
"context": "..",
|
"context": "..",
|
||||||
|
"remoteUser": "vscode",
|
||||||
"appPort": ["5000:5000", "9123:8123"],
|
"appPort": ["5000:5000", "9123:8123"],
|
||||||
"postCreateCommand": "yarn install",
|
"postCreateCommand": "yarn install",
|
||||||
"runArgs": [
|
"runArgs": ["-v", "${localWorkspaceFolder}/.devcontainer/www:/config/www"],
|
||||||
"-v",
|
|
||||||
"${env:HOME}${env:USERPROFILE}/.ssh:/tmp/.ssh", // This is added so you can push from inside the container
|
|
||||||
"-v",
|
|
||||||
"${localWorkspaceFolder}/.devcontainer/www:/config/www"
|
|
||||||
],
|
|
||||||
"extensions": [
|
"extensions": [
|
||||||
"github.vscode-pull-request-github",
|
"github.vscode-pull-request-github",
|
||||||
"eamodio.gitlens",
|
"eamodio.gitlens",
|
||||||
|
|
|
@ -1,20 +0,0 @@
|
||||||
name: "Build"
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
pull_request:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
name: Test build
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v1
|
|
||||||
- name: Build
|
|
||||||
run: |
|
|
||||||
yarn install
|
|
||||||
npm run build
|
|
|
@ -0,0 +1,56 @@
|
||||||
|
name: CI
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- '*'
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- '*'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
lint:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Use Node.js 12.x
|
||||||
|
uses: actions/setup-node@v2.1.4
|
||||||
|
with:
|
||||||
|
node-version: 12.x
|
||||||
|
- name: Cache Node.js modules
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: ~/.npm # npm cache files are stored in `~/.npm` on Linux/macOS
|
||||||
|
key: ${{ runner.OS }}-node-12.x-${{ hashFiles('**/yarn.lock') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.OS }}-node-12.x
|
||||||
|
${{ runner.OS }}-
|
||||||
|
- name: Install dependencies
|
||||||
|
run: yarn install --frozen-lockfile
|
||||||
|
- name: Lint the code
|
||||||
|
run: npm run lint --if-present
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
node-version: [10.x, 12.x]
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Use Node.js ${{ matrix.node-version }}
|
||||||
|
uses: actions/setup-node@v2.1.4
|
||||||
|
with:
|
||||||
|
node-version: ${{ matrix.node-version }}
|
||||||
|
- name: Cache Node.js modules
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: ~/.npm # npm cache files are stored in `~/.npm` on Linux/macOS
|
||||||
|
key: ${{ runner.OS }}-node-${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.OS }}-node-${{ matrix.node-version }}
|
||||||
|
${{ runner.OS }}-
|
||||||
|
- name: Install dependencies
|
||||||
|
run: yarn install --frozen-lockfile
|
||||||
|
- name: Build the project
|
||||||
|
run: npm run build --if-present
|
|
@ -1,30 +1,33 @@
|
||||||
name: Release
|
name: Release
|
||||||
|
|
||||||
on:
|
on: workflow_dispatch
|
||||||
release:
|
|
||||||
types: [published]
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
release:
|
release-bundle:
|
||||||
name: Prepare release
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/dev'
|
||||||
|
|
||||||
|
outputs:
|
||||||
|
new_release_published: ${{ steps.semantic.outputs.new_release_published }}
|
||||||
|
new_release_version: ${{ steps.semantic.outputs.new_release_version }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v2
|
||||||
|
- name: Use Node.js 12.x
|
||||||
# Build
|
uses: actions/setup-node@v2.1.4
|
||||||
- name: Build the file
|
|
||||||
run: |
|
|
||||||
cd /home/runner/work/button-card/button-card
|
|
||||||
yarn install
|
|
||||||
npm run build
|
|
||||||
|
|
||||||
# Upload build file to the releas as an asset.
|
|
||||||
- name: Upload zip to release
|
|
||||||
uses: svenstaro/upload-release-action@v1-release
|
|
||||||
|
|
||||||
with:
|
with:
|
||||||
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
node-version: 12.x
|
||||||
file: /home/runner/work/button-card/button-card/dist/button-card.js
|
- name: Cache Node.js modules
|
||||||
asset_name: button-card.js
|
uses: actions/cache@v2
|
||||||
tag: ${{ github.ref }}
|
with:
|
||||||
overwrite: true
|
path: ~/.npm # npm cache files are stored in `~/.npm` on Linux/macOS
|
||||||
|
key: ${{ runner.OS }}-node-12.x-${{ hashFiles('**/yarn.lock') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.OS }}-node-12.x
|
||||||
|
${{ runner.OS }}-
|
||||||
|
- name: Install dependencies
|
||||||
|
run: yarn install --frozen-lockfile
|
||||||
|
- name: Release
|
||||||
|
run: npx semantic-release
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
73
changelog.md
73
changelog.md
|
@ -1,73 +0,0 @@
|
||||||
## 0.0.3
|
|
||||||
Custom state, label card and icon attribute
|
|
||||||
|
|
||||||
### New features :
|
|
||||||
|
|
||||||
- New setting for custom states
|
|
||||||
- Label card for organization https://github.com/kuuji/button-card/pull/23 by [jxwolstenholme](https://github.com/jxwolstenholme)
|
|
||||||
- Use icon attribute from entity if it exists https://github.com/kuuji/button-card/pull/21 by [emilp333](https://github.com/emilp333)
|
|
||||||
- Support for hex color in auto mode https://github.com/kuuji/button-card/pull/10 by [simo878](https://github.com/simo878)
|
|
||||||
|
|
||||||
#### Custom state example with input select entity
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
- type: "custom:button-card"
|
|
||||||
entity: input_select.cube_mode
|
|
||||||
icon: mdi:cube
|
|
||||||
action: service
|
|
||||||
show_state: true
|
|
||||||
state:
|
|
||||||
- value: 'sleeping'
|
|
||||||
color: var(--disabled-text-color)
|
|
||||||
- value: 'media'
|
|
||||||
color: rgb(5, 147, 255)
|
|
||||||
- value: 'light'
|
|
||||||
color: rgb(189, 255, 5)
|
|
||||||
```
|
|
||||||
|
|
||||||
### Other
|
|
||||||
|
|
||||||
- Allow to show both state and name (and doesn't break the style)
|
|
||||||
- Support for unit of measurement
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## 0.0.2
|
|
||||||
Custom service, blank card and custom_updater support
|
|
||||||
|
|
||||||
### New features :
|
|
||||||
|
|
||||||
- New action type `service`
|
|
||||||
- Service + data configuration
|
|
||||||
- Blank-card
|
|
||||||
- Support for custom_updater
|
|
||||||
|
|
||||||
![volume](examples/volume.png)
|
|
||||||
|
|
||||||
### Other
|
|
||||||
|
|
||||||
- Refactoring
|
|
||||||
- Linting
|
|
||||||
|
|
||||||
|
|
||||||
## 0.0.1
|
|
||||||
Initial release that supports versioning
|
|
||||||
|
|
||||||
### New features :
|
|
||||||
|
|
||||||
- Color on off state
|
|
||||||
- Default color on light (when color set to `auto` and detection fails)
|
|
||||||
- Background color card
|
|
||||||
- Boolean to show/hide state
|
|
||||||
- Automatic font color based on card color (for readability)
|
|
||||||
|
|
||||||
### Changed features :
|
|
||||||
|
|
||||||
- Automatic color mode for lights now has to be enabled via `color: auto`
|
|
||||||
- State display has to be enabled explicity via `show_state: true` and is not enabled by default when an icon is not set
|
|
||||||
|
|
||||||
### Other
|
|
||||||
|
|
||||||
- Lots of refactoring
|
|
||||||
- Versionning
|
|
||||||
|
|
|
@ -35,8 +35,15 @@
|
||||||
"@rollup/plugin-commonjs": "^16.0.0",
|
"@rollup/plugin-commonjs": "^16.0.0",
|
||||||
"@rollup/plugin-json": "^4.0.2",
|
"@rollup/plugin-json": "^4.0.2",
|
||||||
"@rollup/plugin-node-resolve": "^10.0.0",
|
"@rollup/plugin-node-resolve": "^10.0.0",
|
||||||
|
"@semantic-release/changelog": "^5.0.1",
|
||||||
|
"@semantic-release/commit-analyzer": "^8.0.1",
|
||||||
|
"@semantic-release/exec": "^5.0.0",
|
||||||
|
"@semantic-release/git": "^9.0.0",
|
||||||
|
"@semantic-release/npm": "^7.0.10",
|
||||||
|
"@semantic-release/release-notes-generator": "^9.0.1",
|
||||||
"@typescript-eslint/eslint-plugin": "^4.6.1",
|
"@typescript-eslint/eslint-plugin": "^4.6.1",
|
||||||
"@typescript-eslint/parser": "^4.6.1",
|
"@typescript-eslint/parser": "^4.6.1",
|
||||||
|
"conventional-changelog-conventionalcommits": "^4.5.0",
|
||||||
"eslint": "7.12.1",
|
"eslint": "7.12.1",
|
||||||
"eslint-config-airbnb-base": "^14.1.0",
|
"eslint-config-airbnb-base": "^14.1.0",
|
||||||
"eslint-config-prettier": "^6.15.0",
|
"eslint-config-prettier": "^6.15.0",
|
||||||
|
@ -50,6 +57,7 @@
|
||||||
"rollup-plugin-serve": "^1.1.0",
|
"rollup-plugin-serve": "^1.1.0",
|
||||||
"rollup-plugin-terser": "^7.0.2",
|
"rollup-plugin-terser": "^7.0.2",
|
||||||
"rollup-plugin-typescript2": "^0.29.0",
|
"rollup-plugin-typescript2": "^0.29.0",
|
||||||
|
"semantic-release": "^17.3.8",
|
||||||
"ts-lit-plugin": "^1.1.10",
|
"ts-lit-plugin": "^1.1.10",
|
||||||
"typescript": "^4.0.5",
|
"typescript": "^4.0.5",
|
||||||
"typescript-styled-plugin": "^0.15.0"
|
"typescript-styled-plugin": "^0.15.0"
|
||||||
|
|
|
@ -0,0 +1,42 @@
|
||||||
|
/* eslint-disable no-template-curly-in-string */
|
||||||
|
module.exports = {
|
||||||
|
plugins: [
|
||||||
|
'@semantic-release/commit-analyzer',
|
||||||
|
[
|
||||||
|
'@semantic-release/release-notes-generator',
|
||||||
|
{
|
||||||
|
preset: 'conventionalcommits',
|
||||||
|
presetConfig: {
|
||||||
|
types: [
|
||||||
|
{ type: 'feat', section: 'Features' },
|
||||||
|
{ type: 'fix', section: 'Bug Fixes' },
|
||||||
|
{ type: 'doc', hidden: false, section: 'Documentation' },
|
||||||
|
{ type: 'docs', hidden: false, section: 'Documentation' },
|
||||||
|
{ type: 'chore', hidden: true, section: 'Chores' },
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
'@semantic-release/changelog',
|
||||||
|
[
|
||||||
|
'@semantic-release/npm',
|
||||||
|
{
|
||||||
|
npmPublish: false,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'@semantic-release/git',
|
||||||
|
{
|
||||||
|
assets: ['CHANGELOG.md', 'README.md', 'package.json', 'yarn.lock'],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'@semantic-release/github',
|
||||||
|
{
|
||||||
|
assets: 'dist/*.js',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
],
|
||||||
|
preset: 'conventionalcommits',
|
||||||
|
branches: [{ name: 'master' }, { name: 'dev', channel: 'beta', prerelease: true }],
|
||||||
|
};
|
Loading…
Reference in New Issue