diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1d507b4..109a591 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,17 +16,54 @@ jobs: runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v5 + - run: npm i -fg corepack && corepack enable + - uses: actions/setup-node@v4 with: node-version: 20 cache: "pnpm" - - run: pnpm install + + - name: Install dependencies + run: pnpm install + - run: pnpm lint if: ${{ matrix.os != 'windows-latest' }} - - run: pnpm build + + - name: Prepare Package + run: pnpm build if: ${{ matrix.os != 'windows-latest' }} + - run: pnpm test:types if: ${{ matrix.os != 'windows-latest' }} + - run: pnpm vitest --coverage + - uses: codecov/codecov-action@v5 + + release: + name: Release + if: github.ref == 'refs/heads/main' + runs-on: ubuntu-latest + timeout-minutes: 10 + needs: + - ci + steps: + - uses: actions/checkout@v5 + + - uses: actions/setup-node@v4 + with: + node-version: 20 + cache: "pnpm" + + - name: Install dependencies + run: pnpm install + + - name: Prepare Package + run: pnpm build + + - name: Publish to NPM + run: npx semantic-release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/package.json b/package.json index 05e7e7b..97e9d64 100644 --- a/package.json +++ b/package.json @@ -70,5 +70,16 @@ "optional": true } }, + "release": { + "branches": [ + "main" + ], + "plugins": [ + "@semantic-release/commit-analyzer", + "@semantic-release/release-notes-generator", + "@semantic-release/npm", + "@semantic-release/github" + ] + }, "packageManager": "pnpm@10.15.1" } diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml new file mode 100644 index 0000000..012c404 --- /dev/null +++ b/pnpm-workspace.yaml @@ -0,0 +1,3 @@ +onlyBuiltDependencies: + - '@parcel/watcher' + - esbuild