|
| 1 | +name: ReleaseOrVersionPR |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [main] |
| 6 | + |
| 7 | +jobs: |
| 8 | + release: |
| 9 | + # Basic security: the release job can only be executed from this repo and from the main branch (not a remote thing) |
| 10 | + if: ${{ github.repository == 'udecode/better-auth-convex' && contains('refs/heads/main',github.ref)}} |
| 11 | + name: Release and changelog |
| 12 | + runs-on: ubuntu-latest |
| 13 | + steps: |
| 14 | + - name: Checkout Repo |
| 15 | + uses: actions/checkout@v4 |
| 16 | + with: |
| 17 | + # To run comparison we need more than the latest commit. |
| 18 | + # @link https://github.com/actions/checkout#fetch-all-history-for-all-tags-and-branches |
| 19 | + fetch-depth: 0 |
| 20 | + |
| 21 | + - uses: oven-sh/setup-bun@v2 |
| 22 | + name: Install bun |
| 23 | + with: |
| 24 | + bun-version: latest |
| 25 | + |
| 26 | + - name: Use Node.js |
| 27 | + uses: actions/setup-node@v4 |
| 28 | + with: |
| 29 | + node-version: 22 |
| 30 | + |
| 31 | + - uses: actions/cache@v4 |
| 32 | + name: ♻️ Setup bun cache |
| 33 | + with: |
| 34 | + path: ~/.bun/install/cache |
| 35 | + key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lock') }} |
| 36 | + restore-keys: | |
| 37 | + ${{ runner.os }}-bun- |
| 38 | +
|
| 39 | + - name: 📥 Install |
| 40 | + run: bun install --frozen-lockfile |
| 41 | + |
| 42 | + # @link https://github.com/changesets/action |
| 43 | + - name: 🦋 Create Release Pull Request or Publish to npm |
| 44 | + id: changesets |
| 45 | + uses: changesets/action@v1 |
| 46 | + with: |
| 47 | + # publish: yarn g:release |
| 48 | + cwd: ${{ github.workspace }} |
| 49 | + title: '[Release] Version packages' |
| 50 | + publish: bun run release |
| 51 | + # Optional, might be used in conjunction with GITHUB_TOKEN to |
| 52 | + # allow running the workflows on a Version package action. |
| 53 | + # Be aware of security implications. |
| 54 | + # setupGitUser: true |
| 55 | + env: |
| 56 | + # See https://github.com/changesets/action/issues/147 |
| 57 | + HOME: ${{ github.workspace }} |
| 58 | + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
| 59 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 60 | + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |
0 commit comments