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
17 changes: 17 additions & 0 deletions .github/actions/buildable-check-action/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: "Buildable Check"
description: "Try to build library"
runs:
using: 'composite'
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}

- name: "Install dependencies"
run: npm install
shell: bash

- name: "Build library"
run: npm run build
shell: bash
28 changes: 28 additions & 0 deletions .github/actions/demo-quality-check-action/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: "Demo Quality Check"
description: "Run demo specific checks"
runs:
using: 'composite'
steps:
- name: "Checkout repository"
uses: actions/checkout@v2

- name: "Setup Node.js"
uses: actions/setup-node@v2
with:
node-version: '20.x'

- name: "Install dependencies"
run: npm install
shell: bash

- name: "Check lint (ESLint)"
run: npm run eslint-check
shell: bash

- name: "Check lint (Stylelint)"
run: npm run stylelint-check
shell: bash

- name: "Check code formatting (Prettier)"
run: npm run prettier-check
shell: bash
28 changes: 28 additions & 0 deletions .github/actions/lib-quality-check-action/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: "Library Quality Check"
description: "Run library specific checks"
runs:
using: 'composite'
steps:
- name: "Checkout repository"
uses: actions/checkout@v2

- name: "Setup Node.js"
uses: actions/setup-node@v2
with:
node-version: '20.x'

- name: "Install dependencies"
run: npm install
shell: bash

- name: "Check lint (ESLint)"
run: npm run eslint-check
shell: bash

- name: "Check code formatting (Prettier)"
run: npm run prettier-check
shell: bash

- name: "Run tests"
run: npm run unit
shell: bash
53 changes: 53 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
lib:
- changed-files:
- any-glob-to-any-file:
- 'src/**/*'

demo:
- any:
- changed-files:
- any-glob-to-any-file:
- 'demo/**/*'
- head-branch:
- '^demo'

feature:
- all:
- changed-files:
- any-glob-to-any-file:
- 'src/**/*'
- head-branch:
- '^feature'

fix:
- all:
- changed-files:
- any-glob-to-any-file:
- 'src/**/*'
- head-branch:
- '^fix'

test:
- any:
- changed-files:
- any-glob-to-any-file:
- 'src/test/**/*'
- '*.test.*'
- head-branch:
- '^test'

ci:
- any:
- changed-files:
- any-glob-to-any-file:
- '.github/**/*'
- head-branch:
- '^ci'

config:
- any:
- changed-files:
- any-glob-to-any-file:
- '*config*'
- head-branch:
- '^config'
14 changes: 14 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
changelog:
categories:
- title: ⚠️ Breaking Changes
labels:
- breaking
- title: 🚀 New Features
labels:
- feature
- title: 🪛 Bug Fixes
labels:
- fix
- title: Other Changes
labels:
- "*"
59 changes: 0 additions & 59 deletions .github/workflows/ci.yml

This file was deleted.

45 changes: 45 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: "Pull Request"
on:
- pull_request_target
jobs:
labeler:
name: "Label Pull Request"
runs-on: ubuntu-latest
outputs:
labels: ${{ steps.labeler.outputs.all-labels }}
permissions:
contents: read
pull-requests: write
steps:
- id: labeler
uses: actions/labeler@v5

demo-check:
needs: labeler
if: contains(needs.labeler.outputs.labels, 'demo')
name: "Demo Specific Checks"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/demo-quality-check-action

library-check:
needs: labeler
if: contains(needs.labeler.outputs.labels, 'lib')
name: "Library Specific Checks"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/lib-quality-check-action

build-check:
needs: labeler
if: contains(needs.labeler.outputs.labels, 'lib')
name: "Build Check"
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x, 20.x]
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/buildable-check-action
29 changes: 29 additions & 0 deletions .github/workflows/push-main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: "Push Main"
on:
push:
branches:
- main
jobs:
demo-check:
name: "Demo Specific Checks"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/demo-quality-check-action

library-check:
name: "Library Specific Checks"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/lib-quality-check-action

build-check:
name: "Build Check"
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x, 20.x]
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/buildable-check-action
46 changes: 46 additions & 0 deletions .github/workflows/release-draft.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: "Release Draft"
on:
workflow_dispatch:
inputs:
base_tag:
description: Base release tag
required: true
type: string
jobs:
draft:
name: "Generate Release Draft"
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: "Extract semantic version from tag"
id: semver_extractor
uses: actions/github-script@v7
with:
script: |
if (!"${{ inputs.base_tag }}".match(/v[0-9]+\.[0-9]+\.[0-9]+/)) {
core.setFailed('Invalid format of release tag');
return "";
}
return "${{ inputs.base_tag }}".substring(1)
result-encoding: string

- name: "Bump Version"
id: version_bumper
uses: t15i/semver-bump-action@v1.0.0
with:
basehead: ${{ inputs.base_tag }}...${{ github.ref }}
labels: breaking.feature.fix
version: ${{ steps.semver_extractor.outputs.result }}

- uses: actions/checkout@v4

- name: 'Create Release Draft'
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release create v${{ steps.version_bumper.outputs.bumped_version }} \
--draft \
--generate-notes \
--notes-start-tag ${{ inputs.base_tag }} \
--target ${{ github.ref }}
Loading