feat(utils): add createShadow utility for consistent shadow styling #9
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: π 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 |