diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..6626c2e --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,44 @@ +name: CI + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + build-test: + strategy: + matrix: + os: + - ubuntu-latest + - windows-latest + node-version: + - 22.11.0 + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + cache: pnpm + - run: pnpm install --frozen-lockfile + - run: pnpm typecheck + - run: pnpm test + - run: pnpm build + + publish-alpha: + needs: build-test + runs-on: ubuntu-latest + if: github.event_name == 'push' && github.ref_name == 'main' + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 22.11.0 + cache: pnpm + - run: pnpm install --frozen-lockfile + - run: pnpm version 0.0.0-alpha.${{ github.sha}} --no-git-tag-version + - run: pnpm publish --tag alpha diff --git a/package.json b/package.json index a660593..8bac5d5 100644 --- a/package.json +++ b/package.json @@ -12,8 +12,9 @@ ], "scripts": { "build": "tsup", - "prepublishOnly": "npm run build", - "test": "vitest" + "prepublishOnly": "pnpm build", + "test": "vitest", + "typecheck": "tsc -b ." }, "dependencies": { "@inquirer/prompts": "^7.2.1", @@ -37,6 +38,7 @@ "typescript-eslint": "^8.19.1", "vitest": "^2.1.8" }, + "packageManager": "pnpm@9.15.3", "engines": { "node": "^22.11.0" },