fix(editor): 코드 블록 폰트 크기를 본문과 동일하게 (0.9em → 1em) #36
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 to npm | |
| on: | |
| push: | |
| branches: [main] | |
| paths-ignore: | |
| - "*.md" | |
| - ".github/**" | |
| - "dist/**" | |
| - "**/*.test.ts" | |
| - "vitest.config.ts" | |
| workflow_dispatch: | |
| concurrency: | |
| group: publish | |
| cancel-in-progress: false | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 24 | |
| registry-url: https://registry.npmjs.org | |
| - run: npm ci --legacy-peer-deps | |
| - name: Run tests | |
| run: npm test | |
| - name: Determine version | |
| id: version | |
| run: | | |
| git config user.name "github-actions" | |
| git config user.email "github-actions@github.com" | |
| LOCAL=$(node -p "require('./package.json').version") | |
| PUBLISHED=$(npm view @teriusu/rich-editor version 2>/dev/null || echo "0.0.0") | |
| echo "Local: $LOCAL, Published: $PUBLISHED" | |
| HIGHEST=$(printf "%s\n%s" "$LOCAL" "$PUBLISHED" | sort -V | tail -1) | |
| if [ "$LOCAL" = "$HIGHEST" ] && [ "$LOCAL" != "$PUBLISHED" ]; then | |
| echo "LOCAL ($LOCAL) is ahead of PUBLISHED ($PUBLISHED) — use as-is" | |
| echo "BUMPED=false" >> "$GITHUB_ENV" | |
| else | |
| # LOCAL == PUBLISHED (normal auto-bump) or LOCAL < PUBLISHED (prev run published but failed to commit-back) | |
| echo "Bumping patch from PUBLISHED ($PUBLISHED)" | |
| npm version "$PUBLISHED" --no-git-tag-version --allow-same-version | |
| npm version patch --no-git-tag-version | |
| LOCAL=$(node -p "require('./package.json').version") | |
| echo "BUMPED=true" >> "$GITHUB_ENV" | |
| fi | |
| echo "VERSION=$LOCAL" >> "$GITHUB_ENV" | |
| - run: npm run build | |
| - name: Publish | |
| run: npm publish --access public | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| - name: Commit version bump + dist | |
| if: env.BUMPED == 'true' | |
| run: | | |
| git add package.json package-lock.json dist/ | |
| git commit -m "chore: v${VERSION}" || true | |
| git push | |
| - name: Commit dist only | |
| if: env.BUMPED == 'false' | |
| run: | | |
| git add dist/ | |
| git diff --cached --quiet || (git commit -m "chore: dist v${VERSION}" && git push) | |
| - name: Create GitHub Release | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| gh release create "v${VERSION}" \ | |
| --title "v${VERSION}" \ | |
| --generate-notes | |
| - name: Trigger downstream updates | |
| run: | | |
| dispatch() { | |
| local REPO="$1" | |
| local TOKEN="$2" | |
| local STATUS | |
| STATUS=$(curl -s -o /tmp/dispatch.out -w "%{http_code}" -X POST \ | |
| -H "Accept: application/vnd.github+json" \ | |
| -H "Authorization: Bearer ${TOKEN}" \ | |
| "https://api.github.com/repos/${REPO}/dispatches" \ | |
| -d '{"event_type":"rich-editor-published","client_payload":{"version":"'"$VERSION"'"}}') | |
| if [ "$STATUS" = "204" ]; then | |
| echo "Triggered ${REPO}" | |
| else | |
| echo "::error::Failed ${REPO} (HTTP ${STATUS})" | |
| cat /tmp/dispatch.out | |
| exit 1 | |
| fi | |
| } | |
| dispatch "teriusu-ko/hancomac" "${{ secrets.GH_PAT }}" | |
| dispatch "HancomAC/trinity" "${{ secrets.GH_PAT_HANCOMAC }}" |