fix: preserve realtime follow state across views #35
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 | |
| paths: | |
| - 'packages/**' | |
| - 'pnpm-lock.yaml' | |
| - '.github/workflows/release-npm.yml' | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| id-token: write | |
| concurrency: | |
| group: npm-publish-${{ github.ref }} | |
| cancel-in-progress: false | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - uses: pnpm/action-setup@v4 | |
| with: | |
| version: 10 | |
| run_install: false | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 24 | |
| cache: 'pnpm' | |
| registry-url: 'https://registry.npmjs.org' | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Build packages | |
| run: pnpm build:packages | |
| - name: Publish packages | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| run: | | |
| if [ -z "${NODE_AUTH_TOKEN}" ]; then | |
| echo "NPM_TOKEN is not set." | |
| exit 1 | |
| fi | |
| packages=( | |
| "packages/maa-log-kernel" | |
| "packages/maa-log-parser" | |
| "packages/maa-log-runtime" | |
| "packages/maa-log-adapter" | |
| "packages/maa-log-tools" | |
| ) | |
| for pkg_dir in "${packages[@]}"; do | |
| echo "==== ${pkg_dir} ====" | |
| cd "${pkg_dir}" | |
| pkg_name=$(node -p "require('./package.json').name") | |
| pkg_ver=$(node -p "require('./package.json').version") | |
| if npm view "${pkg_name}@${pkg_ver}" >/dev/null 2>&1; then | |
| echo "Skip existing: ${pkg_name}@${pkg_ver}" | |
| cd - >/dev/null | |
| continue | |
| fi | |
| echo "Publish ${pkg_name}@${pkg_ver}" | |
| pnpm publish --access public --provenance --no-git-checks | |
| cd - >/dev/null | |
| done |