refactor: upgrade project setup (#646)

This commit is contained in:
三咲智子 Kevin Deng
2023-06-22 12:14:02 +08:00
committed by GitHub
parent 687be8aca8
commit dbba3205e4
53 changed files with 6861 additions and 12397 deletions

View File

@ -8,16 +8,13 @@ assignees:
### 🐛 Bug description
<!-- Please describe the bug in detail above so that everyone can understand. -->
### 🏞 Desired result
<!-- Please describe above what you expected to see. -->
### 🚑 Other information
<!-- Please enter other information such as screenshots above. -->
<!-- From: https://github.com/one-template/issue-template -->

View File

@ -8,16 +8,13 @@ assignees: ''
### 🧐 Problem Description
<!-- Describe the problem in detail so that everyone can understand. -->
### 💻 Sample code
<!-- If you have a solution, state it clearly here. -->
### 🚑 Other information
<!-- Other information such as screenshots can be posted here. -->
<!-- From: https://github.com/one-template/issue-template -->

25
.github/renovate.json5 vendored Normal file
View File

@ -0,0 +1,25 @@
{
$schema: 'https://docs.renovatebot.com/renovate-schema.json',
extends: [
'config:base',
'schedule:weekly',
'group:allNonMajor',
':semanticCommitTypeAll(chore)',
],
labels: ['dependencies'],
pin: false,
rangeStrategy: 'bump',
node: false,
packageRules: [
{
depTypeList: ['peerDependencies'],
enabled: false,
},
],
ignoreDeps: [
'typescript',
// Pure ESM
'camelcase',
],
}

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

@ -0,0 +1,67 @@
name: CI
permissions: {}
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.number || github.sha }}
cancel-in-progress: true
jobs:
test:
timeout-minutes: 20
runs-on: ubuntu-latest
name: Unit Test
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install pnpm
uses: pnpm/action-setup@v2
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: lts/*
cache: pnpm
- name: Install deps
run: pnpm install
- name: Test unit
run: pnpm run test
lint:
timeout-minutes: 10
runs-on: ubuntu-latest
name: Lint
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install pnpm
uses: pnpm/action-setup@v2
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: lts/*
cache: pnpm
- name: Install deps
run: pnpm install
- name: Lint
run: pnpm run lint
- name: Check formatting
run: pnpm prettier --check .
- name: Typecheck
run: pnpm run typecheck

View File

@ -10,7 +10,7 @@ jobs:
steps:
- name: help wanted
if: github.event.label.name == 'help wanted'
uses: actions-cool/issues-helper@v2.5.0
uses: actions-cool/issues-helper@v3
with:
actions: 'create-comment'
issue-number: ${{ github.event.issue.number }}
@ -19,7 +19,7 @@ jobs:
- name: need reproduction
if: github.event.label.name == 'need reproduction'
uses: actions-cool/issues-helper@v2.5.0
uses: actions-cool/issues-helper@v3
with:
actions: 'create-comment'
issue-number: ${{ github.event.issue.number }}

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

@ -0,0 +1,40 @@
name: Release
on:
push:
tags:
- 'v*'
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install pnpm
uses: pnpm/action-setup@v2
- name: Set node
uses: actions/setup-node@v3
with:
node-version: lts/*
cache: pnpm
registry-url: 'https://registry.npmjs.org'
- run: npx changelogithub
continue-on-error: true
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
- name: Install Dependencies
run: pnpm i
- name: PNPM build
run: pnpm run build
- name: Publish to NPM
run: pnpm -r publish --access public --no-git-checks
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}