fix: cleanup cards #26
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 and Publish | |
| on: | |
| push: | |
| branches: | |
| - master | |
| workflow_dispatch: | |
| jobs: | |
| release: | |
| name: Create Release and Publish | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| id-token: write | |
| issues: write | |
| pull-requests: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '24' | |
| registry-url: 'https://registry.npmjs.org' | |
| scope: '@calimero-network' | |
| token: false | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Build | |
| run: pnpm build | |
| - name: Typecheck | |
| run: pnpm typecheck | |
| - name: Configure Git | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| - name: Run semantic-release | |
| id: semantic | |
| run: | | |
| OUTPUT=$(pnpm exec semantic-release 2>&1) | |
| echo "$OUTPUT" | |
| if echo "$OUTPUT" | grep -q "Published release"; then | |
| echo "new_release=true" >> $GITHUB_OUTPUT | |
| else | |
| echo "new_release=false" >> $GITHUB_OUTPUT | |
| echo "No new release" | |
| fi | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| NODE_ENV: production | |
| - name: Publish to npm with OIDC | |
| if: steps.semantic.outputs.new_release == 'true' | |
| run: npm publish --provenance --access public | |
| - name: Push release commit and tag | |
| if: steps.semantic.outputs.new_release == 'true' | |
| run: | | |
| git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git | |
| git push origin HEAD:master --follow-tags || true |