diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..57bb3b3f --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,38 @@ +name: Release + +on: + push: + branches: + - main + +concurrency: ${{ github.workflow }}-${{ github.ref }} + +permissions: + contents: write + pull-requests: write + id-token: write + +jobs: + release: + name: Release + runs-on: ubuntu-latest + steps: + - name: Checkout Repo + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version-file: '.nvmrc' + + - name: Install Dependencies + run: npm ci + + - name: Create Release Pull Request or Publish to npm + id: changesets + uses: changesets/action@v1 + with: + publish: npm run release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/README.md b/README.md index 9a99072a..096cedac 100644 --- a/README.md +++ b/README.md @@ -27,3 +27,13 @@ A simple component that renders "Hello World". ```tsx ``` + +## Contributing + +When submitting a pull request, please include a changeset to document your changes: + +```bash +npx changeset +``` + +This helps us maintain the changelog and version the package appropriately. diff --git a/package.json b/package.json index 513d64f7..5851536e 100644 --- a/package.json +++ b/package.json @@ -48,6 +48,7 @@ "format": "prettier --write .", "check-format": "prettier --check .", "check-exports": "attw --pack . --ignore-rules cjs-resolves-to-esm no-resolution", + "release": "npm run build && changeset publish", "local-release": "npm run ci && changeset version && changeset publish" }, "peerDependencies": {