diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..c17efc6 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,87 @@ +name: CI + +on: + push: + branches: + - master + + pull_request: + branches: + - master + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Install pnpm + uses: pnpm/action-setup@v2 + + - name: Set node + uses: actions/setup-node@v3 + with: + node-version: lts/* + + - name: Setup + run: npm i -g @antfu/ni + + - name: Install + run: nci + + - name: Lint + run: nr lint + + typecheck: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Install pnpm + uses: pnpm/action-setup@v2 + + - name: Set node + uses: actions/setup-node@v3 + with: + node-version: lts/* + + - name: Setup + run: npm i -g @antfu/ni + + - name: Install + run: nci + + - name: Typecheck + run: nr typecheck + + test: + runs-on: ${{ matrix.os }} + + strategy: + matrix: + node: [lts/*] + os: [ubuntu-latest, windows-latest, macos-latest] + fail-fast: false + + steps: + - uses: actions/checkout@v3 + + - name: Install pnpm + uses: pnpm/action-setup@v2 + + - name: Set node ${{ matrix.node }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node }} + + - name: Setup + run: npm i -g @antfu/ni + + - name: Install + run: nci + + - name: Build + run: nr build + + - name: Test + run: nr test diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..7a4094d --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,29 @@ +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: Install pnpm + uses: pnpm/action-setup@v2 + + - name: Set node + uses: actions/setup-node@v3 + with: + node-version: lts/* + + - run: npx changelogithub + env: + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/package.json b/package.json index 3fb1bc4..e6ae4f3 100644 --- a/package.json +++ b/package.json @@ -22,6 +22,7 @@ "prepublishOnly": "npm run build", "release": "bumpp && npm publish", "prepare": "simple-git-hooks", + "typecheck": "tsc --noEmit", "test": "vitest" }, "dependencies": {