🧩 Release SDKs #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
| # Entrypoint workflow for releasing JavaScript SDKs. | |
| # Jobs are arranged as a DAG matching the SDK dependency graph. | |
| # SDKs at the same dependency level run concurrently; push conflicts are | |
| # handled by a retry-with-rebase loop in the publish step. | |
| name: 🧩 Release SDKs | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| bump_type: | |
| description: 'Version bump type' | |
| required: true | |
| type: choice | |
| options: | |
| - patch | |
| - minor | |
| - major | |
| default: patch | |
| confirm_major: | |
| description: 'Check to confirm intentional major bump (required when bump_type is major)' | |
| required: false | |
| type: boolean | |
| default: false | |
| sdk_browser: | |
| description: '@thunderid/browser' | |
| required: false | |
| type: boolean | |
| default: false | |
| sdk_express: | |
| description: '@thunderid/express' | |
| required: false | |
| type: boolean | |
| default: false | |
| sdk_javascript: | |
| description: '@thunderid/javascript' | |
| required: false | |
| type: boolean | |
| default: false | |
| sdk_nextjs: | |
| description: '@thunderid/nextjs' | |
| required: false | |
| type: boolean | |
| default: false | |
| sdk_node: | |
| description: '@thunderid/node' | |
| required: false | |
| type: boolean | |
| default: false | |
| sdk_nuxt: | |
| description: '@thunderid/nuxt' | |
| required: false | |
| type: boolean | |
| default: false | |
| sdk_react: | |
| description: '@thunderid/react' | |
| required: false | |
| type: boolean | |
| default: false | |
| sdk_react_router: | |
| description: '@thunderid/react-router' | |
| required: false | |
| type: boolean | |
| default: false | |
| sdk_tanstack_router: | |
| description: '@thunderid/tanstack-router' | |
| required: false | |
| type: boolean | |
| default: false | |
| sdk_vue: | |
| description: '@thunderid/vue' | |
| required: false | |
| type: boolean | |
| default: false | |
| permissions: | |
| contents: write | |
| # IMPORTANT: DO NOT REMOVE. `id-token` is required for OIDC publishing. | |
| id-token: write | |
| env: | |
| RELEASE_GIT_USER_NAME: "thunderid[bot]" | |
| RELEASE_GIT_USER_EMAIL: "thunderid[bot]@users.noreply.thunderid.dev" | |
| NODE_VERSION: "lts/*" | |
| jobs: | |
| validate: | |
| name: ✅ Validate Inputs | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Guard against accidental major bump | |
| if: github.event.inputs.bump_type == 'major' && github.event.inputs.confirm_major != 'true' | |
| run: | | |
| echo "❌ bump_type is 'major' but confirm_major is not checked. Enable confirm_major to proceed." | |
| exit 1 | |
| # ── Level 0 ──────────────────────────────────────────────────────────────── | |
| release-javascript: | |
| name: 📜 Release @thunderid/javascript | |
| needs: [validate] | |
| if: needs.validate.result == 'success' && github.event.inputs.sdk_javascript == 'true' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: 📥 Checkout Code | |
| uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | |
| with: | |
| token: ${{ secrets.THUNDERID_AUTOMATION_BOT }} | |
| - name: 📦 Set up pnpm | |
| uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4.3.0 | |
| with: | |
| version: latest | |
| - name: ⚙️ Set up Node.js | |
| uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| registry-url: 'https://registry.npmjs.org' | |
| cache: 'pnpm' | |
| - name: 📦 Install Dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: 🏷️ Bump Version | |
| id: bump | |
| run: | | |
| cd packages/javascript | |
| pnpm version ${{ github.event.inputs.bump_type }} --no-git-tag-version | |
| echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT | |
| - name: 🔨 Build | |
| run: pnpm nx run @thunderid/javascript:build | |
| - name: 📤 Commit, Tag & Push | |
| run: | | |
| git config user.name "${{ env.RELEASE_GIT_USER_NAME }}" | |
| git config user.email "${{ env.RELEASE_GIT_USER_EMAIL }}" | |
| git add packages/javascript/package.json | |
| git diff --cached --quiet || git commit -m "[Release] @thunderid/javascript@${{ steps.bump.outputs.version }}" | |
| for i in $(seq 1 5); do | |
| git pull --rebase origin ${{ github.ref_name }} | |
| git push origin HEAD:${{ github.ref_name }} && break | |
| [ "$i" -eq 5 ] && exit 1 | |
| sleep $((i * 3)) | |
| done | |
| git tag "sdk/javascript/v${{ steps.bump.outputs.version }}" | |
| git push origin "sdk/javascript/v${{ steps.bump.outputs.version }}" | |
| - name: 📦 Publish to npm | |
| run: pnpm publish --no-git-checks --access public --provenance | |
| working-directory: packages/javascript | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| # ── Level 1: depends on javascript ───────────────────────────────────────── | |
| release-browser: | |
| name: 🌐 Release @thunderid/browser | |
| needs: [validate, release-javascript] | |
| if: ${{ always() && needs.validate.result == 'success' && (needs.release-javascript.result == 'success' || needs.release-javascript.result == 'skipped') && github.event.inputs.sdk_browser == 'true' }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: 📥 Checkout Code | |
| uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | |
| with: | |
| token: ${{ secrets.THUNDERID_AUTOMATION_BOT }} | |
| - name: 📦 Set up pnpm | |
| uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4.3.0 | |
| with: | |
| version: latest | |
| - name: ⚙️ Set up Node.js | |
| uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| registry-url: 'https://registry.npmjs.org' | |
| cache: 'pnpm' | |
| - name: 📦 Install Dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: 🏷️ Bump Version | |
| id: bump | |
| run: | | |
| cd packages/browser | |
| pnpm version ${{ github.event.inputs.bump_type }} --no-git-tag-version | |
| echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT | |
| - name: 🔨 Build | |
| run: pnpm nx run @thunderid/browser:build | |
| - name: 📤 Commit, Tag & Push | |
| run: | | |
| git config user.name "${{ env.RELEASE_GIT_USER_NAME }}" | |
| git config user.email "${{ env.RELEASE_GIT_USER_EMAIL }}" | |
| git add packages/browser/package.json | |
| git diff --cached --quiet || git commit -m "[Release] @thunderid/browser@${{ steps.bump.outputs.version }}" | |
| for i in $(seq 1 5); do | |
| git pull --rebase origin ${{ github.ref_name }} | |
| git push origin HEAD:${{ github.ref_name }} && break | |
| [ "$i" -eq 5 ] && exit 1 | |
| sleep $((i * 3)) | |
| done | |
| git tag "sdk/browser/v${{ steps.bump.outputs.version }}" | |
| git push origin "sdk/browser/v${{ steps.bump.outputs.version }}" | |
| - name: 📦 Publish to npm | |
| run: pnpm publish --no-git-checks --access public --provenance | |
| working-directory: packages/browser | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| release-node: | |
| name: 🟢 Release @thunderid/node | |
| needs: [validate, release-javascript] | |
| if: ${{ always() && needs.validate.result == 'success' && (needs.release-javascript.result == 'success' || needs.release-javascript.result == 'skipped') && github.event.inputs.sdk_node == 'true' }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: 📥 Checkout Code | |
| uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | |
| with: | |
| token: ${{ secrets.THUNDERID_AUTOMATION_BOT }} | |
| - name: 📦 Set up pnpm | |
| uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4.3.0 | |
| with: | |
| version: latest | |
| - name: ⚙️ Set up Node.js | |
| uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| registry-url: 'https://registry.npmjs.org' | |
| cache: 'pnpm' | |
| - name: 📦 Install Dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: 🏷️ Bump Version | |
| id: bump | |
| run: | | |
| cd packages/node | |
| pnpm version ${{ github.event.inputs.bump_type }} --no-git-tag-version | |
| echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT | |
| - name: 🔨 Build | |
| run: pnpm nx run @thunderid/node:build | |
| - name: 📤 Commit, Tag & Push | |
| run: | | |
| git config user.name "${{ env.RELEASE_GIT_USER_NAME }}" | |
| git config user.email "${{ env.RELEASE_GIT_USER_EMAIL }}" | |
| git add packages/node/package.json | |
| git diff --cached --quiet || git commit -m "[Release] @thunderid/node@${{ steps.bump.outputs.version }}" | |
| for i in $(seq 1 5); do | |
| git pull --rebase origin ${{ github.ref_name }} | |
| git push origin HEAD:${{ github.ref_name }} && break | |
| [ "$i" -eq 5 ] && exit 1 | |
| sleep $((i * 3)) | |
| done | |
| git tag "sdk/node/v${{ steps.bump.outputs.version }}" | |
| git push origin "sdk/node/v${{ steps.bump.outputs.version }}" | |
| - name: 📦 Publish to npm | |
| run: pnpm publish --no-git-checks --access public --provenance | |
| working-directory: packages/node | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| # ── Level 2: depends on browser / node ───────────────────────────────────── | |
| release-express: | |
| name: 🚂 Release @thunderid/express | |
| needs: [validate, release-node] | |
| if: ${{ always() && needs.validate.result == 'success' && (needs.release-node.result == 'success' || needs.release-node.result == 'skipped') && github.event.inputs.sdk_express == 'true' }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: 📥 Checkout Code | |
| uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | |
| with: | |
| token: ${{ secrets.THUNDERID_AUTOMATION_BOT }} | |
| - name: 📦 Set up pnpm | |
| uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4.3.0 | |
| with: | |
| version: latest | |
| - name: ⚙️ Set up Node.js | |
| uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| registry-url: 'https://registry.npmjs.org' | |
| cache: 'pnpm' | |
| - name: 📦 Install Dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: 🏷️ Bump Version | |
| id: bump | |
| run: | | |
| cd packages/express | |
| pnpm version ${{ github.event.inputs.bump_type }} --no-git-tag-version | |
| echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT | |
| - name: 🔨 Build | |
| run: pnpm nx run @thunderid/express:build | |
| - name: 📤 Commit, Tag & Push | |
| run: | | |
| git config user.name "${{ env.RELEASE_GIT_USER_NAME }}" | |
| git config user.email "${{ env.RELEASE_GIT_USER_EMAIL }}" | |
| git add packages/express/package.json | |
| git diff --cached --quiet || git commit -m "[Release] @thunderid/express@${{ steps.bump.outputs.version }}" | |
| for i in $(seq 1 5); do | |
| git pull --rebase origin ${{ github.ref_name }} | |
| git push origin HEAD:${{ github.ref_name }} && break | |
| [ "$i" -eq 5 ] && exit 1 | |
| sleep $((i * 3)) | |
| done | |
| git tag "sdk/express/v${{ steps.bump.outputs.version }}" | |
| git push origin "sdk/express/v${{ steps.bump.outputs.version }}" | |
| - name: 📦 Publish to npm | |
| run: pnpm publish --no-git-checks --access public --provenance | |
| working-directory: packages/express | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| release-react: | |
| name: ⚛️ Release @thunderid/react | |
| needs: [validate, release-browser] | |
| if: ${{ always() && needs.validate.result == 'success' && (needs.release-browser.result == 'success' || needs.release-browser.result == 'skipped') && github.event.inputs.sdk_react == 'true' }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: 📥 Checkout Code | |
| uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | |
| with: | |
| token: ${{ secrets.THUNDERID_AUTOMATION_BOT }} | |
| - name: 📦 Set up pnpm | |
| uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4.3.0 | |
| with: | |
| version: latest | |
| - name: ⚙️ Set up Node.js | |
| uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| registry-url: 'https://registry.npmjs.org' | |
| cache: 'pnpm' | |
| - name: 📦 Install Dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: 🏷️ Bump Version | |
| id: bump | |
| run: | | |
| cd packages/react | |
| pnpm version ${{ github.event.inputs.bump_type }} --no-git-tag-version | |
| echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT | |
| - name: 🔨 Build | |
| run: pnpm nx run @thunderid/react:build | |
| - name: 📤 Commit, Tag & Push | |
| run: | | |
| git config user.name "${{ env.RELEASE_GIT_USER_NAME }}" | |
| git config user.email "${{ env.RELEASE_GIT_USER_EMAIL }}" | |
| git add packages/react/package.json | |
| git diff --cached --quiet || git commit -m "[Release] @thunderid/react@${{ steps.bump.outputs.version }}" | |
| for i in $(seq 1 5); do | |
| git pull --rebase origin ${{ github.ref_name }} | |
| git push origin HEAD:${{ github.ref_name }} && break | |
| [ "$i" -eq 5 ] && exit 1 | |
| sleep $((i * 3)) | |
| done | |
| git tag "sdk/react/v${{ steps.bump.outputs.version }}" | |
| git push origin "sdk/react/v${{ steps.bump.outputs.version }}" | |
| - name: 📦 Publish to npm | |
| run: pnpm publish --no-git-checks --access public --provenance | |
| working-directory: packages/react | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| release-vue: | |
| name: 🟩 Release @thunderid/vue | |
| needs: [validate, release-browser] | |
| if: ${{ always() && needs.validate.result == 'success' && (needs.release-browser.result == 'success' || needs.release-browser.result == 'skipped') && github.event.inputs.sdk_vue == 'true' }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: 📥 Checkout Code | |
| uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | |
| with: | |
| token: ${{ secrets.THUNDERID_AUTOMATION_BOT }} | |
| - name: 📦 Set up pnpm | |
| uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4.3.0 | |
| with: | |
| version: latest | |
| - name: ⚙️ Set up Node.js | |
| uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| registry-url: 'https://registry.npmjs.org' | |
| cache: 'pnpm' | |
| - name: 📦 Install Dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: 🏷️ Bump Version | |
| id: bump | |
| run: | | |
| cd packages/vue | |
| pnpm version ${{ github.event.inputs.bump_type }} --no-git-tag-version | |
| echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT | |
| - name: 🔨 Build | |
| run: pnpm nx run @thunderid/vue:build | |
| - name: 📤 Commit, Tag & Push | |
| run: | | |
| git config user.name "${{ env.RELEASE_GIT_USER_NAME }}" | |
| git config user.email "${{ env.RELEASE_GIT_USER_EMAIL }}" | |
| git add packages/vue/package.json | |
| git diff --cached --quiet || git commit -m "[Release] @thunderid/vue@${{ steps.bump.outputs.version }}" | |
| for i in $(seq 1 5); do | |
| git pull --rebase origin ${{ github.ref_name }} | |
| git push origin HEAD:${{ github.ref_name }} && break | |
| [ "$i" -eq 5 ] && exit 1 | |
| sleep $((i * 3)) | |
| done | |
| git tag "sdk/vue/v${{ steps.bump.outputs.version }}" | |
| git push origin "sdk/vue/v${{ steps.bump.outputs.version }}" | |
| - name: 📦 Publish to npm | |
| run: pnpm publish --no-git-checks --access public --provenance | |
| working-directory: packages/vue | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| # ── Level 3: depends on react / node+react / browser+node+vue ────────────── | |
| release-react-router: | |
| name: 🔀 Release @thunderid/react-router | |
| needs: [validate, release-react] | |
| if: ${{ always() && needs.validate.result == 'success' && (needs.release-react.result == 'success' || needs.release-react.result == 'skipped') && github.event.inputs.sdk_react_router == 'true' }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: 📥 Checkout Code | |
| uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | |
| with: | |
| token: ${{ secrets.THUNDERID_AUTOMATION_BOT }} | |
| - name: 📦 Set up pnpm | |
| uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4.3.0 | |
| with: | |
| version: latest | |
| - name: ⚙️ Set up Node.js | |
| uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| registry-url: 'https://registry.npmjs.org' | |
| cache: 'pnpm' | |
| - name: 📦 Install Dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: 🏷️ Bump Version | |
| id: bump | |
| run: | | |
| cd packages/react-router | |
| pnpm version ${{ github.event.inputs.bump_type }} --no-git-tag-version | |
| echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT | |
| - name: 🔨 Build | |
| run: pnpm nx run @thunderid/react-router:build | |
| - name: 📤 Commit, Tag & Push | |
| run: | | |
| git config user.name "${{ env.RELEASE_GIT_USER_NAME }}" | |
| git config user.email "${{ env.RELEASE_GIT_USER_EMAIL }}" | |
| git add packages/react-router/package.json | |
| git diff --cached --quiet || git commit -m "[Release] @thunderid/react-router@${{ steps.bump.outputs.version }}" | |
| for i in $(seq 1 5); do | |
| git pull --rebase origin ${{ github.ref_name }} | |
| git push origin HEAD:${{ github.ref_name }} && break | |
| [ "$i" -eq 5 ] && exit 1 | |
| sleep $((i * 3)) | |
| done | |
| git tag "sdk/react-router/v${{ steps.bump.outputs.version }}" | |
| git push origin "sdk/react-router/v${{ steps.bump.outputs.version }}" | |
| - name: 📦 Publish to npm | |
| run: pnpm publish --no-git-checks --access public --provenance | |
| working-directory: packages/react-router | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| release-tanstack-router: | |
| name: 🔱 Release @thunderid/tanstack-router | |
| needs: [validate, release-react] | |
| if: ${{ always() && needs.validate.result == 'success' && (needs.release-react.result == 'success' || needs.release-react.result == 'skipped') && github.event.inputs.sdk_tanstack_router == 'true' }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: 📥 Checkout Code | |
| uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | |
| with: | |
| token: ${{ secrets.THUNDERID_AUTOMATION_BOT }} | |
| - name: 📦 Set up pnpm | |
| uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4.3.0 | |
| with: | |
| version: latest | |
| - name: ⚙️ Set up Node.js | |
| uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| registry-url: 'https://registry.npmjs.org' | |
| cache: 'pnpm' | |
| - name: 📦 Install Dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: 🏷️ Bump Version | |
| id: bump | |
| run: | | |
| cd packages/tanstack-router | |
| pnpm version ${{ github.event.inputs.bump_type }} --no-git-tag-version | |
| echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT | |
| - name: 🔨 Build | |
| run: pnpm nx run @thunderid/tanstack-router:build | |
| - name: 📤 Commit, Tag & Push | |
| run: | | |
| git config user.name "${{ env.RELEASE_GIT_USER_NAME }}" | |
| git config user.email "${{ env.RELEASE_GIT_USER_EMAIL }}" | |
| git add packages/tanstack-router/package.json | |
| git diff --cached --quiet || git commit -m "[Release] @thunderid/tanstack-router@${{ steps.bump.outputs.version }}" | |
| for i in $(seq 1 5); do | |
| git pull --rebase origin ${{ github.ref_name }} | |
| git push origin HEAD:${{ github.ref_name }} && break | |
| [ "$i" -eq 5 ] && exit 1 | |
| sleep $((i * 3)) | |
| done | |
| git tag "sdk/tanstack-router/v${{ steps.bump.outputs.version }}" | |
| git push origin "sdk/tanstack-router/v${{ steps.bump.outputs.version }}" | |
| - name: 📦 Publish to npm | |
| run: pnpm publish --no-git-checks --access public --provenance | |
| working-directory: packages/tanstack-router | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| release-nextjs: | |
| name: ▲ Release @thunderid/nextjs | |
| needs: [validate, release-node, release-react] | |
| if: ${{ always() && needs.validate.result == 'success' && (needs.release-node.result == 'success' || needs.release-node.result == 'skipped') && (needs.release-react.result == 'success' || needs.release-react.result == 'skipped') && github.event.inputs.sdk_nextjs == 'true' }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: 📥 Checkout Code | |
| uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | |
| with: | |
| token: ${{ secrets.THUNDERID_AUTOMATION_BOT }} | |
| - name: 📦 Set up pnpm | |
| uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4.3.0 | |
| with: | |
| version: latest | |
| - name: ⚙️ Set up Node.js | |
| uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| registry-url: 'https://registry.npmjs.org' | |
| cache: 'pnpm' | |
| - name: 📦 Install Dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: 🏷️ Bump Version | |
| id: bump | |
| run: | | |
| cd packages/nextjs | |
| pnpm version ${{ github.event.inputs.bump_type }} --no-git-tag-version | |
| echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT | |
| - name: 🔨 Build | |
| run: pnpm nx run @thunderid/nextjs:build | |
| - name: 📤 Commit, Tag & Push | |
| run: | | |
| git config user.name "${{ env.RELEASE_GIT_USER_NAME }}" | |
| git config user.email "${{ env.RELEASE_GIT_USER_EMAIL }}" | |
| git add packages/nextjs/package.json | |
| git diff --cached --quiet || git commit -m "[Release] @thunderid/nextjs@${{ steps.bump.outputs.version }}" | |
| for i in $(seq 1 5); do | |
| git pull --rebase origin ${{ github.ref_name }} | |
| git push origin HEAD:${{ github.ref_name }} && break | |
| [ "$i" -eq 5 ] && exit 1 | |
| sleep $((i * 3)) | |
| done | |
| git tag "sdk/nextjs/v${{ steps.bump.outputs.version }}" | |
| git push origin "sdk/nextjs/v${{ steps.bump.outputs.version }}" | |
| - name: 📦 Publish to npm | |
| run: pnpm publish --no-git-checks --access public --provenance | |
| working-directory: packages/nextjs | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| release-nuxt: | |
| name: 💚 Release @thunderid/nuxt | |
| needs: [validate, release-browser, release-node, release-vue] | |
| if: ${{ always() && needs.validate.result == 'success' && (needs.release-browser.result == 'success' || needs.release-browser.result == 'skipped') && (needs.release-node.result == 'success' || needs.release-node.result == 'skipped') && (needs.release-vue.result == 'success' || needs.release-vue.result == 'skipped') && github.event.inputs.sdk_nuxt == 'true' }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: 📥 Checkout Code | |
| uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | |
| with: | |
| token: ${{ secrets.THUNDERID_AUTOMATION_BOT }} | |
| - name: 📦 Set up pnpm | |
| uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4.3.0 | |
| with: | |
| version: latest | |
| - name: ⚙️ Set up Node.js | |
| uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| registry-url: 'https://registry.npmjs.org' | |
| cache: 'pnpm' | |
| - name: 📦 Install Dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: 🏷️ Bump Version | |
| id: bump | |
| run: | | |
| cd packages/nuxt | |
| pnpm version ${{ github.event.inputs.bump_type }} --no-git-tag-version | |
| echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT | |
| - name: 🔨 Build | |
| run: pnpm nx run @thunderid/nuxt:build | |
| - name: 📤 Commit, Tag & Push | |
| run: | | |
| git config user.name "${{ env.RELEASE_GIT_USER_NAME }}" | |
| git config user.email "${{ env.RELEASE_GIT_USER_EMAIL }}" | |
| git add packages/nuxt/package.json | |
| git diff --cached --quiet || git commit -m "[Release] @thunderid/nuxt@${{ steps.bump.outputs.version }}" | |
| for i in $(seq 1 5); do | |
| git pull --rebase origin ${{ github.ref_name }} | |
| git push origin HEAD:${{ github.ref_name }} && break | |
| [ "$i" -eq 5 ] && exit 1 | |
| sleep $((i * 3)) | |
| done | |
| git tag "sdk/nuxt/v${{ steps.bump.outputs.version }}" | |
| git push origin "sdk/nuxt/v${{ steps.bump.outputs.version }}" | |
| - name: 📦 Publish to npm | |
| run: pnpm publish --no-git-checks --access public --provenance | |
| working-directory: packages/nuxt | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |