Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions .github/workflows/release-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Release Build

# Triggered when release-please publishes a new GitHub Release.
# Builds dist/ from source at the tagged commit, zips it, and attaches
# the zip as a release asset. HACS picks up the zip via hacs.json's
# `zip_release: true` flag.
#
# Separates concerns from release-please: that workflow owns versioning
# + changelog + tagging; this one owns producing the artifact users
# install. Either can be retried independently.

on:
release:
types: [published]
workflow_dispatch:
inputs:
tag:
description: 'Tag to build (e.g. v1.4.0). Defaults to the latest release.'
required: false

permissions:
contents: write

jobs:
build:
name: Build + attach dist zip
runs-on: ubuntu-latest
steps:
- name: Determine ref
id: ref
run: |
if [ -n "${{ github.event.inputs.tag }}" ]; then
echo "ref=${{ github.event.inputs.tag }}" >> "$GITHUB_OUTPUT"
else
echo "ref=${{ github.event.release.tag_name }}" >> "$GITHUB_OUTPUT"
fi

- uses: actions/checkout@v4
with:
ref: ${{ steps.ref.outputs.ref }}

- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Build
run: npm run build

- name: Package dist into a zip
run: |
cd dist
zip -r ../simon42-dashboard-strategy.zip .
cd ..
ls -la simon42-dashboard-strategy.zip

- name: Attach zip to the release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release upload "${{ steps.ref.outputs.ref }}" \
simon42-dashboard-strategy.zip \
--clobber
34 changes: 34 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Release Please

# Manages version bumps + changelog + tags via conventional commits.
#
# How it works:
# 1. On every push to main, this workflow checks the commits since the last
# release. If any commits follow Conventional Commits format (feat:, fix:,
# feat!: etc.), it maintains a permanent "Release PR" that:
# - bumps package.json's version (patch / minor / major based on commits)
# - updates CHANGELOG.md
# 2. When the maintainer merges that PR, release-please creates a git tag
# and a GitHub Release with the changelog as the body.
# 3. The release event triggers .github/workflows/release-build.yml, which
# builds dist/ and attaches a zip as a release asset for HACS.
#
# The maintainer's job is simply to merge the Release PR when ready —
# no manual version bumps, no manual changelog edits, no manual tagging.

on:
push:
branches: [main]
workflow_dispatch:

permissions:
contents: write
pull-requests: write

jobs:
release-please:
runs-on: ubuntu-latest
steps:
- uses: googleapis/release-please-action@v4
with:
release-type: node
13 changes: 13 additions & 0 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,16 @@ jobs:
- uses: hacs/action@main
with:
category: plugin

lint:
name: ESLint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- run: npm ci
- name: Run ESLint
run: npm run lint