diff --git a/.github/workflows/changesets.yml b/.github/workflows/changesets.yml new file mode 100644 index 0000000..41261e6 --- /dev/null +++ b/.github/workflows/changesets.yml @@ -0,0 +1,51 @@ +name: ๐Ÿ†• Release management + +on: + workflow_dispatch: + push: + branches: + - main + paths-ignore: + - '.vscode/**' + - 'demo/**' + - '*.md' + +concurrency: ${{ github.workflow }}-${{ github.ref }} + +permissions: + contents: write + pull-requests: write + +jobs: + main: + name: Publish changed packages + runs-on: ubuntu-latest + steps: + - name: ๐Ÿ— Setup repo + uses: actions/checkout@v4 + + - name: ๐Ÿ— Setup pnpm + uses: pnpm/action-setup@v4 + with: + version: 9 + + - name: ๐Ÿ— Setup Node + uses: actions/setup-node@v3 + with: + node-version: 18.x + cache: pnpm + + - name: ๐Ÿ“ฆ Install dependencies + run: pnpm install + + - name: ๐Ÿ†• Publish to npm or create release PR + id: changesets + uses: changesets/action@v1 + with: + title: '๐Ÿ†• Upcoming release' + commit: 'chore: bump version' + version: pnpm run version + publish: pnpm run release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml new file mode 100644 index 0000000..e4bae7a --- /dev/null +++ b/.github/workflows/checks.yml @@ -0,0 +1,69 @@ +name: ๐Ÿ•ต๏ธ Checks + +on: + workflow_dispatch: + push: + paths-ignore: + - '.vscode/**' + - 'demo/**' + - '*.md' + +permissions: + contents: read + +jobs: + build: + name: ๐Ÿงฑ Build + runs-on: ubuntu-latest + permissions: + contents: read + steps: + - name: ๐Ÿ— Setup repo + uses: actions/checkout@v4 + + - name: ๐Ÿ— Setup pnpm + uses: pnpm/action-setup@v4 + with: + version: 9 + + - name: ๐Ÿ— Setup Node + uses: actions/setup-node@v3 + with: + node-version: 18.x + cache: pnpm + + - name: ๐Ÿ“ฆ Install dependencies + run: pnpm install + + - name: ๐Ÿงฑ Build project + run: pnpm build + + test: + name: ๐Ÿงช Test + strategy: + matrix: + os: [ubuntu-latest] + node-version: [18.x, 20.x] + + runs-on: ${{ matrix.os }} + + steps: + - name: ๐Ÿ— Setup repo + uses: actions/checkout@v4 + + - name: ๐Ÿ— Setup pnpm + uses: pnpm/action-setup@v4 + with: + version: 9 + + - name: ๐Ÿ— Setup Node + uses: actions/setup-node@v3 + with: + node-version: 18.x + cache: pnpm + + - name: ๐Ÿ“ฆ Install dependencies + run: pnpm install + + - name: ๐Ÿงช Run tests + run: pnpm test