Merge pull request #21 from kamsteegsoftware/feature/logging #22
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: Publish next | |
| on: | |
| push: | |
| branches: | |
| - develop | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| packages: write | |
| id-token: write | |
| jobs: | |
| publish-next: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: "1.3.14" | |
| - run: bun install --frozen-lockfile | |
| - run: bun run build | |
| - run: bunx changeset version --snapshot "next-$(git rev-parse --short HEAD)" --snapshot-prerelease-template "{tag}" | |
| - run: bun publish --registry https://npm.pkg.github.com --tag next --tolerate-republish | |
| env: | |
| NPM_CONFIG_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| # bun publish does not support npm's OIDC "Trusted Publishing" yet | |
| # (oven-sh/bun#22423, #24855), so the npm registry step uses the npm CLI instead. | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: "22" | |
| - run: npm install -g npm@latest | |
| - name: Publish to npm | |
| run: | | |
| pkg_name=$(node -p "require('./package.json').name") | |
| pkg_version=$(node -p "require('./package.json').version") | |
| if npm view "$pkg_name@$pkg_version" version --registry https://registry.npmjs.org >/dev/null 2>&1; then | |
| echo "$pkg_name@$pkg_version already published to npm, skipping" | |
| else | |
| npm publish --registry https://registry.npmjs.org --tag next --access public | |
| fi |