diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..fb7db4a --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,81 @@ +name: CI + +on: + push: + branches: + - master + + pull_request: + branches: + - master + + merge_group: {} + +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: 18 + cache: pnpm + + - name: Setup + run: npm i -g pnpm@8 + + - name: Install + run: pnpm i + + test: + runs-on: ${{ matrix.os }} + + strategy: + matrix: + os: [ubuntu-latest] + node_version: [16, 18] + include: + - os: macos-latest + node_version: 18 + - os: windows-latest + node_version: 18 + fail-fast: false + + steps: + - name: Set git to use LF + run: | + git config --global core.autocrlf false + git config --global core.eol lf + + - uses: actions/checkout@v3 + + - name: Install pnpm + uses: pnpm/action-setup@v2 + + - name: Set node ${{ matrix.node_version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node_version }} + cache: pnpm + + - run: corepack enable + + - name: Setup + run: npm i -g pnpm@8 + + - name: Install + run: pnpm i + + - name: Build + run: pnpm run build + + - name: Test + run: pnpm run test + + - name: Typecheck + run: pnpm run typecheck \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..1b39919 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,49 @@ +name: Release + +on: + push: + tags: + - 'v*' + +jobs: + release: + permissions: + id-token: write + contents: write + 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: 18 + cache: pnpm + registry-url: 'https://registry.npmjs.org' + + - run: npx changelogithub + env: + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + + - name: Install Dependencies + run: pnpm i + + - name: PNPM build + run: pnpm run build + + - name: Publish to NPM + run: pnpm publish --access public --no-git-checks + env: + NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} + NPM_CONFIG_PROVENANCE: true + + - name: Publish to VSCE + run: npm run publish + working-directory: ./vscode + env: + VSCE_TOKEN: ${{secrets.VSCE_TOKEN}} \ No newline at end of file diff --git a/package.json b/package.json index abb1701..747091d 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,7 @@ "play": "npm -C playground run dev", "test": "vitest", "typecheck": "tsc --noEmit", - "release": "bumpp & npm publish & npm -C vscode run publish", + "release": "bumpp -r", "prepublishOnly": "npm run build" }, "keywords": [