-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
142 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
name: "Extract engines" | ||
description: "Extract engines from package.json" | ||
outputs: | ||
node: | ||
description: "node version" | ||
value: ${{ steps.information.engines.name }} | ||
pnpm: | ||
description: "pnpm version" | ||
value: ${{ steps.information.engines.description }} | ||
runs: | ||
using: "composite" | ||
steps: | ||
- id: engines | ||
shell: bash | ||
run: | | ||
echo ::set-output name=node::$(jq --raw-output .engines.node ./package.json) | ||
echo ::set-output name=pnpm::$(jq --raw-output .engines.pnpm ./package.json) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
name: 'CI' | ||
|
||
on: [ push, pull_request ] | ||
|
||
jobs: | ||
lint: | ||
name: Lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: "Checkout the repository" | ||
uses: actions/checkout@v2 | ||
|
||
- name: "Extract engines" | ||
id: engines | ||
uses: ./.github/actions/engines | ||
|
||
- name: "Setup pnpm" | ||
uses: pnpm/action-setup@v2 | ||
with: | ||
version: ${{ steps.engines.outputs.pnpm }} | ||
|
||
- name: "Setup node" | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: ${{ steps.engines.outputs.node }} | ||
cache: ${{ !env.ACT && 'pnpm' || '' }} | ||
|
||
- name: "Install dependencies" | ||
run: pnpm install | ||
|
||
- name: "Run Lint" | ||
run: pnpm run lint -s | ||
|
||
- name: "Check format" | ||
run: pnpm run format:check | ||
|
||
build: | ||
name: Build & Test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: "Checkout the repository" | ||
uses: actions/checkout@v2 | ||
|
||
- name: "Extract engines" | ||
id: engines | ||
uses: ./.github/actions/engines | ||
|
||
- name: "Setup pnpm" | ||
uses: pnpm/action-setup@v2 | ||
with: | ||
version: ${{ steps.engines.outputs.pnpm }} | ||
|
||
- name: "Setup node" | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: ${{ steps.engines.outputs.node }} | ||
cache: ${{ !env.ACT && 'pnpm' || '' }} | ||
|
||
- name: "Install dependencies" | ||
run: pnpm install | ||
|
||
- name: "Run Build" | ||
run: pnpm run build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
name: Validate HACS | ||
|
||
on: | ||
push: | ||
pull_request: | ||
schedule: | ||
- cron: "0 0 * * *" | ||
|
||
jobs: | ||
hacs: | ||
name: Validate HACS | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: hacs/action@main | ||
with: | ||
category: "plugin" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: 'Publish' | ||
|
||
on: | ||
release: | ||
types: [ published ] | ||
|
||
jobs: | ||
publish: | ||
name: Publish | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: "Checkout the repository" | ||
uses: actions/checkout@v2 | ||
|
||
- name: "Update version" | ||
run: | | ||
current="$(jq --raw-output .version package.json | sed 's/\./\\./g')" | ||
sed -i s/$current/${{ github.event.release.tag_name }}/ package.json | ||
- name: "Extract engines" | ||
id: engines | ||
uses: ./.github/actions/engines | ||
|
||
- name: "Setup pnpm" | ||
uses: pnpm/action-setup@v2 | ||
with: | ||
version: ${{ steps.engines.outputs.pnpm }} | ||
|
||
- name: "Setup node" | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: ${{ steps.engines.outputs.node }} | ||
cache: ${{ !env.ACT && 'pnpm' || '' }} | ||
|
||
- name: "Install dependencies" | ||
run: pnpm install | ||
|
||
- name: "Run Build" | ||
run: pnpm run build | ||
|
||
- name: "Upload assets" | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
gh release upload ${{ github.event.release.tag_name }} dist/* |