Skip to content

Commit

Permalink
Create github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
GRA0007 committed Jul 4, 2023
1 parent b850d0b commit d4ddb6b
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
"extends": ["plugin:@typescript-eslint/recommended", "plugin:react/recommended"],
"parser": "@typescript-eslint/parser",
"plugins": ["react", "@typescript-eslint"],
"settings": {
"react": { "version": "detect" }
},
"rules": {
"comma-spacing": "warn",
"react/display-name": "off",
Expand Down
42 changes: 42 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Check

on:
pull_request:
paths:
- 'lib/**'
- 'test/**'
- '.eslintrc.json'
- 'tsconfig.json'
- '.github/workflows/check.yml'

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
cache: 'yarn'
- run: yarn install --immutable
- run: yarn lint
typecheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
cache: 'yarn'
- run: yarn install --immutable
- run: yarn tsc
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
cache: 'yarn'
- run: yarn install --immutable
- run: yarn test
28 changes: 28 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Release

on:
push:
branches: ['main']
paths:
- '**/package.json'
- '.changeset/**'
- '.github/workflows/release.yml'

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version: 18
cache: 'yarn'
- run: yarn install --immutable
- uses: changesets/action@v1
with:
publish: yarn ci:release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"dev": "vite",
"build": "tsc && vite build",
"test": "vitest",
"lint": "eslint lib test example --max-warnings 0",
"ci:release": "yarn build && yarn changeset publish"
},
"type": "module",
Expand Down

0 comments on commit d4ddb6b

Please sign in to comment.