diff --git a/.changeset/README.md b/.changeset/README.md new file mode 100644 index 0000000..e5b6d8d --- /dev/null +++ b/.changeset/README.md @@ -0,0 +1,8 @@ +# Changesets + +Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works +with multi-package repos, or single-package repos to help you version and publish your code. You can +find the full documentation for it [in our repository](https://github.com/changesets/changesets) + +We have a quick list of common questions to get you started engaging with this project in +[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md) diff --git a/.changeset/config.json b/.changeset/config.json new file mode 100644 index 0000000..689826e --- /dev/null +++ b/.changeset/config.json @@ -0,0 +1,11 @@ +{ + "$schema": "https://unpkg.com/@changesets/config@3.0.0/schema.json", + "changelog": "@changesets/cli/changelog", + "commit": false, + "fixed": [], + "linked": [], + "access": "public", + "baseBranch": "main", + "updateInternalDependencies": "patch", + "ignore": [] +} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..9642901 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,40 @@ +name: Release + +on: + push: + branches: + - main + +concurrency: ${{ github.workflow }}-${{ github.ref }} + +jobs: + release: + name: Release + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + id-token: write + steps: + - name: Checkout Repo + uses: actions/checkout@v3 + + - name: Setup Bun + uses: oven-sh/setup-bun@v1 + + - name: Install Dependencies + run: bun install + + - name: Create Release Pull Request or Publish to npm + id: changesets + uses: changesets/action@v1 + with: + publish: bun release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + + # - name: Send a Slack notification if a publish happens + # if: steps.changesets.outputs.published == 'true' + # # You can do something when a publish happens. + # run: my-slack-bot send-notification --message "A new version of ${GITHUB_REPOSITORY} was published!" diff --git a/bun.lockb b/bun.lockb index c9f1343..ff915fe 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index e8338fa..8fcc884 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,9 @@ "types": "dist/index.d.ts", "scripts": { "build": "bunx tsc", - "prepublishOnly": "bun run build", + "changeset": "changeset", + "prerelease": "pnpm build", + "release": "changeset publish", "format:check": "prettier --check ." }, "files": [ @@ -20,6 +22,7 @@ "bugs": "https://github.com/wobsoriano/pkg-name/issues", "author": "Christoffer Bjelke", "devDependencies": { + "@changesets/cli": "^2.27.1", "@types/bun": "latest", "@types/react": "^18.2.57", "@types/react-dom": "^18.2.19", @@ -30,5 +33,8 @@ }, "peerDependencies": { "react-dom": "^18.2.0" + }, + "publishConfig": { + "provenance": true } }