Merge pull request #49 from hypercerts-org/chore/publish_public #4
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 Beta | |
| on: | |
| push: | |
| branches: [develop] | |
| concurrency: ${{ github.workflow }}-${{ github.ref }} | |
| jobs: | |
| release-beta: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - uses: pnpm/action-setup@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: "pnpm" | |
| registry-url: "https://registry.npmjs.org" | |
| - run: pnpm install | |
| - run: pnpm build | |
| - run: pnpm test | |
| - name: Enter prerelease mode (if not already) | |
| run: | | |
| if [ ! -f .changeset/pre.json ]; then | |
| pnpm changeset pre enter beta | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git add .changeset/pre.json | |
| git commit -m "chore: enter beta prerelease mode" | |
| fi | |
| - name: Version packages | |
| run: pnpm changeset version | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Create .npmrc | |
| run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc | |
| - name: Publish beta packages | |
| run: pnpm changeset publish | |
| - name: Commit and push version changes | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git add -A | |
| git diff --staged --quiet || git commit -m "chore: version packages (beta)" | |
| git push |