Skip to content

feat(utils): add createShadow utility for consistent shadow styling #9

feat(utils): add createShadow utility for consistent shadow styling

feat(utils): add createShadow utility for consistent shadow styling #9

Workflow file for this run

name: πŸš€ Publish NPM Packages
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
permissions:
contents: write
packages: write
jobs:
# Job untuk testing dan linting (berjalan di semua push/PR)
test:
name: πŸ§ͺ Test & Lint
runs-on: ubuntu-latest
steps:
- name: πŸ“₯ Checkout code
uses: actions/checkout@v4
- name: 🟒 Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22.16.0'
registry-url: 'https://registry.npmjs.org'
- name: πŸ“¦ Setup Bun
uses: oven-sh/setup-bun@v1
with:
bun-version: '1.2.17'
- name: πŸ“₯ Install dependencies
run: bun install
- name: πŸ” Run linting
run: bun run lint
- name: πŸ—οΈ Build all libraries
run: bun run build:libs
# Job untuk publish (hanya berjalan di main branch)
publish:
name: πŸ“¦ Publish to NPM
runs-on: ubuntu-latest
needs: test
# Hanya berjalan jika push ke main branch (bukan PR)
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
steps:
- name: πŸ“₯ Checkout code
uses: actions/checkout@v4
with:
# Fetch full history untuk git operations
fetch-depth: 0
- name: 🟒 Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22.16.0'
registry-url: 'https://registry.npmjs.org'
- name: πŸ“¦ Setup Bun
uses: oven-sh/setup-bun@v1
with:
bun-version: '1.2.17'
- name: πŸ“₯ Install dependencies
run: bun install
- name: πŸ”§ Configure git
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
- name: πŸš€ Publish to NPM
run: node tools/scripts/publish-all.js
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: πŸ“ Commit version changes
run: |
git add .
if git diff --staged --quiet; then
echo "No changes to commit"
else
git commit -m "πŸ”– Auto-bump package versions [skip ci]"
git push origin main
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Job untuk notifikasi (opsional)
notify:
name: πŸ“¬ Notify
runs-on: ubuntu-latest
needs: [test, publish]
if: always() && github.event_name == 'push' && github.ref == 'refs/heads/main'
steps:
- name: πŸ“¬ Notify success
if: needs.publish.result == 'success'
run: |
echo "βœ… NPM packages published successfully!"
- name: πŸ“¬ Notify failure
if: needs.publish.result == 'failure'
run: |
echo "❌ NPM package publishing failed!"
exit 1