Skip to content

feat: Support Wildcard Paths in Next SDK Middleware and Support Commo… #226

feat: Support Wildcard Paths in Next SDK Middleware and Support Commo…

feat: Support Wildcard Paths in Next SDK Middleware and Support Commo… #226

name: Release - React SDK next
on:
push:
branches:
- main
env:
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
jobs:
release:
name: Release Next
runs-on: ubuntu-latest
steps:
- name: Get token
id: get_token
uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a # v2.1.0
with:
private_key: ${{ secrets.RELEASE_APP_PEM }}
app_id: ${{ secrets.RELEASE_APP_ID }}
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
# persist-credentials: false
token: ${{ steps.get_token.outputs.token }}
ref: ${{ github.ref }}
- name: Run git config
run: |
git config user.name github-actions
git config user.email [email protected]
- name: Use Latest Corepack
run: |
echo "Before: corepack version => $(corepack --version || echo 'not installed')"
npm install -g corepack@latest
echo "After : corepack version => $(corepack --version)"
corepack enable
pnpm --version
- name: Setup Node
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
cache: 'pnpm'
node-version-file: package.json
registry-url: https://registry.npmjs.org/
- name: Install dependencies
run: pnpm install --frozen-lockfile --ignore-scripts
env:
CI: true
- name: Check if should run
id: 'check'
run: |
# Check if the affected projects include "react-sdk" or "web-component" since the last commit
if $(npx nx show projects --affected --base HEAD~1 --head HEAD | grep -q "react-sdk\|web-component"); then
echo "run=true" >> $GITHUB_OUTPUT
else
echo "run=false" >> $GITHUB_OUTPUT
fi
- name: Build
if: steps.check.outputs.run == 'true'
run: npm run version:ci
env:
CI: true
GITHUB_TOKEN: ${{ steps.get_token.outputs.token }}
- name: Set Next Version
run: |
SHORT_SHA=$(echo ${{ github.sha }} | cut -c1-8)
CURRENT_DATE=$(date +'%Y%m%d')
echo "NEXT_VERSION=0.0.0-next-${SHORT_SHA}-${CURRENT_DATE}" >> $GITHUB_ENV
- name: Run pnpm publish
if: steps.check.outputs.run == 'true'
run: |
pnpm --filter "@descope/react-sdk" exec npm version "${NEXT_VERSION}" --git-tag-version=false
pnpm --filter "@descope/react-sdk" publish --access=public --no-git-checks --tag=next
env:
CI: true
NODE_AUTH_TOKEN: ${{ secrets.CI_NPM_REGISTRY }}