Skip to content

fix(angular): use null literal in filterParams to fix TypeScript error #493

fix(angular): use null literal in filterParams to fix TypeScript error

fix(angular): use null literal in filterParams to fix TypeScript error #493

name: Publish Release
on:
pull_request:
types:
- closed
permissions:
contents: write
jobs:
publish:
if: github.event.pull_request.merged == true && startsWith(github.event.pull_request.head.ref, 'release/v')
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version: 24
- name: Setup Bun
uses: oven-sh/setup-bun@v2
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Run build
run: bun run build
- name: Configure npm authentication
run: |
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > .npmrc
- name: Fail if unsafe lifecycle scripts exist
run: |
echo "Checking for unsafe lifecycle scripts in workspaces..."
for pkg in packages/*/package.json; do
if [ -f "$pkg" ]; then
if jq -e '.scripts // {} | to_entries[] | select(.key | test("^(prepack|prepare|prepublish|prepublishOnly|postinstall)$"))' "$pkg" > /dev/null; then
echo "! Unsafe lifecycle script found in $pkg"
jq '.scripts // {} | to_entries[] | select(.key | test("^(prepack|prepare|prepublish|prepublishOnly|postinstall)$"))' "$pkg"
exit 1
fi
fi
done
echo "No unsafe lifecycle scripts detected."
- name: Publish workspaces to npm
run: |
failed=0
for pkg in packages/*/package.json; do
dir=$(dirname "$pkg")
if ! jq -e '.private' "$pkg" > /dev/null 2>&1 || [ "$(jq -r '.private' "$pkg")" = "false" ] || [ "$(jq -r '.private' "$pkg")" = "null" ]; then
echo "Publishing $(jq -r '.name' "$pkg")..."
if ! (cd "$dir" && bun publish --access public); then
echo "Publish failed for $(jq -r '.name' "$pkg")"
failed=1
fi
fi
done
if [ "$failed" -ne 0 ]; then
echo "One or more packages failed to publish."
exit 1
fi
- name: Extract version
id: version
run: |
VERSION=$(node -p "require('./package.json').version")
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: Create GitHub Tag
run: |
git tag v${{ steps.version.outputs.version }}
git push origin v${{ steps.version.outputs.version }}
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ steps.version.outputs.version }}
name: Release v${{ steps.version.outputs.version }}
draft: false
prerelease: false