chore: add changeset for restructuring to Bun workspace monorepo #31
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release | |
| on: | |
| push: | |
| branches: [main] | |
| workflow_dispatch: | |
| concurrency: ${{ github.workflow }}-${{ github.ref }} | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| id-token: write # Required for OIDC | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: { fetch-depth: 0 } | |
| - uses: oven-sh/setup-bun@v2 | |
| - run: bun install --frozen-lockfile | |
| - run: bun run build | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| - name: Create Release PR or Detect Publishable Versions | |
| id: changesets | |
| uses: changesets/action@v1 | |
| with: | |
| version: bun run changeset:version | |
| commit: "chore: release" | |
| title: "chore: release" | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Publish to npm | |
| if: steps.changesets.outputs.hasChangesets == 'false' | |
| working-directory: packages/classy-store | |
| run: | | |
| npm install -g npm@latest | |
| PKG_NAME=$(node -p "require('./package.json').name") | |
| PKG_VERSION=$(node -p "require('./package.json').version") | |
| if npm view "${PKG_NAME}@${PKG_VERSION}" version 2>/dev/null; then | |
| echo "Version ${PKG_VERSION} already published — skipping." | |
| else | |
| npm publish --provenance --access public | |
| fi | |
| - name: Create git tags | |
| if: steps.changesets.outputs.hasChangesets == 'false' | |
| run: | | |
| npx changeset tag | |
| git push --follow-tags | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |