feat: github settings

This commit is contained in:
Simon
2025-09-29 19:28:45 +08:00
parent 3beaa5c284
commit f04609300a
7 changed files with 209 additions and 0 deletions

37
.github/ISSUE_TEMPLATE/bug_report.yml vendored Normal file
View File

@@ -0,0 +1,37 @@
name: Bug Report
description: Report a bug
title: '[Bug] '
labels: ['bug']
body:
- type: textarea
id: description
attributes:
label: What happened?
placeholder: Describe the bug and expected behavior
validations:
required: true
- type: textarea
id: code
attributes:
label: Code
render: typescript
placeholder: Minimal reproduction code
validations:
required: true
- type: input
id: browser
attributes:
label: Browser
placeholder: 'Chrome 120, Firefox 119, etc.'
validations:
required: true
- type: input
id: version
attributes:
label: version
placeholder: '0.0.0'
validations:
required: true

View File

@@ -0,0 +1,28 @@
name: Feature Request
description: Suggest a feature
title: '[Feature] '
labels: ['enhancement']
body:
- type: textarea
id: problem
attributes:
label: Problem
placeholder: What problem does this solve?
validations:
required: true
- type: textarea
id: solution
attributes:
label: Solution
placeholder: How should this work?
validations:
required: true
- type: textarea
id: api
attributes:
label: Proposed API
render: typescript
validations:
required: false

18
.github/PULL_REQUEST_TEMPLATE.md vendored Normal file
View File

@@ -0,0 +1,18 @@
## What
Brief description of changes.
## Type
- [ ] Bug fix
- [ ] New feature
- [ ] Breaking change
- [ ] Documentation
## Testing
- [ ] Tested in modern browsers
- [ ] No console errors
- [ ] Types/doc added
Closes #(issue)

13
.github/dependabot.yml vendored Normal file
View File

@@ -0,0 +1,13 @@
version: 2
updates:
- package-ecosystem: 'npm'
directory: '/'
schedule:
interval: 'weekly'
open-pull-requests-limit: 10
- package-ecosystem: 'github-actions'
directory: '/'
schedule:
interval: 'weekly'
open-pull-requests-limit: 5

34
.github/workflows/ci.yml vendored Normal file
View File

@@ -0,0 +1,34 @@
permissions:
contents: read
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20, 22]
steps:
- uses: actions/checkout@v5
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: Install dependencies
run: npm install
- name: Lint
run: npx eslint . && npx prettier --check **/*.ts
- name: Build
run: npm run build

40
.github/workflows/deploy-demo.yml vendored Normal file
View File

@@ -0,0 +1,40 @@
name: Deploy Demo
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
permissions:
contents: read
pages: write
id-token: write
steps:
- uses: actions/checkout@v5
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Build demo
run: npm run build
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Upload artifact
uses: actions/upload-pages-artifact@v4
with:
path: './dist'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

39
.github/workflows/release.yml vendored Normal file
View File

@@ -0,0 +1,39 @@
name: Release
on:
push:
tags:
- 'v*'
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v5
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build:lib
- name: Publish to npm
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
name: Release ${{ github.ref_name }}
draft: false
prerelease: false