diff --git a/.github/workflows/release.yml b/.github/workflows/ci.yml similarity index 62% rename from .github/workflows/release.yml rename to .github/workflows/ci.yml index 884d8d2..a2d299f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/ci.yml @@ -1,14 +1,22 @@ -name: Release +name: CI Flow on: - - workflow_dispatch + pull_request: + push: + branches: + - main jobs: publish: runs-on: ubuntu-latest + + if: github.ref == 'refs/heads/main' + steps: - name: Checkout uses: actions/checkout@v4 + with: + fetch-depth: 0 - name: PNPM Install uses: pnpm/action-setup@v4 @@ -34,8 +42,13 @@ jobs: - name: Build run: pnpm build - - name: Publish to npm - working-directory: packages/devtools - run: npm publish --access public + - name: Create Release Pull Request or Publish + if: github.ref == 'refs/heads/main' + id: changesets + uses: changesets/action@v1 + with: + publish: pnpm release env: + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}