fix(biome-plugin): use GritQL includes syntax for biome 2.4.x compat #306
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: Release | |
| on: | |
| push: | |
| branches: [main] | |
| concurrency: ${{ github.workflow }}-${{ github.ref }} | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| id-token: write | |
| jobs: | |
| release-please: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| releases_created: ${{ steps.release.outputs.releases_created }} | |
| paths_released: ${{ steps.release.outputs.paths_released }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Release Please | |
| id: release | |
| uses: googleapis/release-please-action@v4 | |
| with: | |
| token: ${{ secrets.RELEASE_PLEASE_TOKEN || secrets.GITHUB_TOKEN }} | |
| config-file: .release-please-config.json | |
| manifest-file: .release-please-manifest.json | |
| publish-npm: | |
| needs: release-please | |
| if: needs.release-please.outputs.releases_created == 'true' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Check for npm packages | |
| id: check-npm | |
| run: | | |
| PATHS='${{ needs.release-please.outputs.paths_released }}' | |
| HAS_NPM=$(echo "$PATHS" | jq -r '[.[] | select(endswith("-dart") | not)] | length > 0') | |
| echo "has_npm_packages=$HAS_NPM" >> $GITHUB_OUTPUT | |
| - name: Setup Bun | |
| if: steps.check-npm.outputs.has_npm_packages == 'true' | |
| uses: oven-sh/setup-bun@v1 | |
| with: | |
| bun-version: latest | |
| - name: Setup Node.js | |
| if: steps.check-npm.outputs.has_npm_packages == 'true' | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "24" | |
| registry-url: "https://registry.npmjs.org" | |
| - name: Install dependencies | |
| if: steps.check-npm.outputs.has_npm_packages == 'true' | |
| run: bun install --frozen-lockfile | |
| - name: Build all packages | |
| if: steps.check-npm.outputs.has_npm_packages == 'true' | |
| run: bun run --filter './packages/*' build | |
| - name: Publish changed packages | |
| if: steps.check-npm.outputs.has_npm_packages == 'true' | |
| run: | | |
| PATHS='${{ needs.release-please.outputs.paths_released }}' | |
| for pkg in $(echo "$PATHS" | jq -r '.[]'); do | |
| if [[ "$pkg" == packages/* ]] && [[ "$pkg" != *"-dart" ]]; then | |
| echo "Publishing $pkg..." | |
| cd "$pkg" | |
| bun publish --access public | |
| cd - | |
| fi | |
| done | |
| env: | |
| NPM_CONFIG_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| publish-dart: | |
| needs: release-please | |
| if: needs.release-please.outputs.releases_created == 'true' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Get Dart packages to publish | |
| id: dart-packages | |
| run: | | |
| PATHS='${{ needs.release-please.outputs.paths_released }}' | |
| DART_PACKAGES=$(echo "$PATHS" | jq -c '[.[] | select(endswith("-dart"))]') | |
| COUNT=$(echo "$DART_PACKAGES" | jq 'length') | |
| echo "packages=$DART_PACKAGES" >> $GITHUB_OUTPUT | |
| echo "count=$COUNT" >> $GITHUB_OUTPUT | |
| - name: Setup Flutter | |
| if: steps.dart-packages.outputs.count != '0' | |
| uses: subosito/flutter-action@v2 | |
| with: | |
| channel: stable | |
| - name: Setup pub.dev credentials | |
| if: steps.dart-packages.outputs.count != '0' | |
| run: | | |
| mkdir -p $XDG_CONFIG_HOME/dart | |
| echo '${{ secrets.PUB_CREDENTIALS }}' > "$XDG_CONFIG_HOME/dart/pub-credentials.json" | |
| - name: Publish Dart packages | |
| if: steps.dart-packages.outputs.count != '0' | |
| run: | | |
| PACKAGES='${{ steps.dart-packages.outputs.packages }}' | |
| for pkg in $(echo "$PACKAGES" | jq -r '.[]'); do | |
| echo "Publishing $pkg..." | |
| cd "$pkg" | |
| flutter pub get | |
| dart analyze | |
| flutter pub publish --force | |
| cd - | |
| done | |
| publish-zotero: | |
| needs: release-please | |
| if: needs.release-please.outputs.releases_created == 'true' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Check for Zotero packages | |
| id: check-zotero | |
| run: | | |
| PATHS='${{ needs.release-please.outputs.paths_released }}' | |
| HAS_ZOTERO=$(echo "$PATHS" | jq -r '[.[] | select(. == "packages/zotero-plugin-uts")] | length > 0') | |
| echo "has_zotero_package=$HAS_ZOTERO" >> $GITHUB_OUTPUT | |
| - name: Setup Bun | |
| if: steps.check-zotero.outputs.has_zotero_package == 'true' | |
| uses: oven-sh/setup-bun@v1 | |
| with: | |
| bun-version: latest | |
| - name: Install dependencies | |
| if: steps.check-zotero.outputs.has_zotero_package == 'true' | |
| run: bun install --frozen-lockfile | |
| - name: Get new version | |
| id: version | |
| if: steps.check-zotero.outputs.has_zotero_package == 'true' | |
| run: | | |
| VERSION=$(node -p "require('./packages/zotero-plugin-uts/package.json').version") | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| echo "tag=zotero-plugin-uts@$VERSION" >> $GITHUB_OUTPUT | |
| - name: Build .xpi file | |
| if: steps.check-zotero.outputs.has_zotero_package == 'true' | |
| run: | | |
| cd packages/zotero-plugin-uts | |
| bun run build:xpi | |
| - name: Update updates.json | |
| if: steps.check-zotero.outputs.has_zotero_package == 'true' | |
| run: | | |
| VERSION='${{ steps.version.outputs.version }}' | |
| TAG='${{ steps.version.outputs.tag }}' | |
| UPDATE_FILE='packages/zotero-plugin-uts/updates.json' | |
| # Update updates.json using jq | |
| cat "$UPDATE_FILE" | jq --arg v "$VERSION" --arg t "$TAG" ' | |
| .addons["uts-citation@gracefullight.dev"].updates |= . + [{ | |
| "version": $v, | |
| "update_link": ("https://github.com/gracefullight/pkgs/releases/download/\($t)/zotero-plugin-uts@\($v).xpi"), | |
| "applications": { | |
| "zotero": { | |
| "strict_min_version": "7.0", | |
| "strict_max_version": "8.*" | |
| } | |
| } | |
| }] | |
| ' > "$UPDATE_FILE.tmp" && mv "$UPDATE_FILE.tmp" "$UPDATE_FILE" | |
| - name: Commit updates.json | |
| if: steps.check-zotero.outputs.has_zotero_package == 'true' | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git add packages/zotero-plugin-uts/updates.json | |
| git commit -m "chore: update updates.json for ${{ steps.version.outputs.version }}" | |
| - name: Push updates.json | |
| if: steps.check-zotero.outputs.has_zotero_package == 'true' | |
| uses: ad-m/github-push-action@master | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| branch: main | |
| - name: Upload XPI as artifact | |
| if: steps.check-zotero.outputs.has_zotero_package == 'true' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: zotero-plugin-uts-xpi | |
| path: packages/zotero-plugin-uts/zotero-plugin-uts@*.xpi | |
| retention-days: 30 | |
| - name: Upload .xpi to Release | |
| if: steps.check-zotero.outputs.has_zotero_package == 'true' | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ steps.version.outputs.tag }} | |
| files: packages/zotero-plugin-uts/zotero-plugin-uts@*.xpi | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |