Skip to content

Commit

Permalink
chore: add scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
qin-guan committed Sep 24, 2023
1 parent 1271638 commit 0d0a74a
Show file tree
Hide file tree
Showing 5 changed files with 91 additions and 1 deletion.
36 changes: 36 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: ci

permissions:
contents: read

on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch: {}

jobs:
ci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: corepack enable
- uses: actions/setup-node@v3
with:
node-version: 18
cache: pnpm

- name: 📦 Install dependencies
run: pnpm install --frozen-lockfile

- name: 🚧 Set up project
run: pnpm nuxi prepare

- name: 📝 Lint
run: pnpm lint

- name: 💪 Type check
run: pnpm typecheck
26 changes: 26 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Release

permissions:
contents: write

on:
push:
tags:
- 'v*'

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set node
uses: actions/setup-node@v3
with:
node-version: 18

- run: npx changelogithub
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
24 changes: 24 additions & 0 deletions .github/workflows/sementic-pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Semantic Pull Request

on:
pull_request_target:
types:
- opened
- edited
- synchronize

permissions: {}

jobs:
main:
permissions:
pull-requests: read # to analyze PRs (amannn/action-semantic-pull-request)
statuses: write # to mark status of analyzed PR (amannn/action-semantic-pull-request)

runs-on: ubuntu-latest
name: Semantic Pull Request
steps:
- name: Validate PR title
uses: amannn/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 2 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ export default antfu({
stylistic: true, // enable stylistic formatting rules
typescript: true,
vue: true,
jsonc: true,
yaml: true,
}, {
rules: {
// https://github.com/antfu/eslint-config/pull/214
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
"db:generate": "drizzle-kit generate:sqlite",
"db:push": "drizzle-kit push:sqlite",
"db:drop": "drizzle-kit drop",
"pwa:generate-assets": "pwa-assets-generator --preset minimal public/logo.png"
"pwa:generate-assets": "pwa-assets-generator --preset minimal public/logo.png",
"lint": "eslint --cache .",
"lint:fix": "eslint --cache --fix ."
},
"devDependencies": {
"@antfu/eslint-config": "latest",
Expand Down

0 comments on commit 0d0a74a

Please sign in to comment.