chore: bump version to 3.2.15 #38
Workflow file for this run
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: | |
| tags: ["v*"] | |
| permissions: | |
| contents: write | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| create-release: | |
| name: Create Release | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Create GitHub Release | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| gh release create "${{ github.ref_name }}" \ | |
| --repo "${{ github.repository }}" \ | |
| --title "Infigraph ${{ github.ref_name }}" \ | |
| --generate-notes | |
| build-driver: | |
| name: Build Driver JAR | |
| needs: create-release | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-java@v4 | |
| with: | |
| distribution: temurin | |
| java-version: '17' | |
| - name: Build infigraph-driver.jar | |
| run: bash driver/build.sh | |
| - name: Upload driver artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: infigraph-driver | |
| path: driver/infigraph-driver.jar | |
| build: | |
| name: Build (${{ matrix.target }}) | |
| needs: [create-release, build-driver] | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: macos-latest | |
| target: aarch64-apple-darwin | |
| archive: tar.gz | |
| cargo_features: "" | |
| - os: macos-latest | |
| target: x86_64-apple-darwin | |
| archive: tar.gz | |
| cargo_features: "--no-default-features" | |
| - os: ubuntu-latest | |
| target: x86_64-unknown-linux-gnu | |
| archive: tar.gz | |
| cargo_features: "" | |
| - os: ubuntu-24.04-arm | |
| target: aarch64-unknown-linux-gnu | |
| archive: tar.gz | |
| cargo_features: "" | |
| - os: windows-latest | |
| target: x86_64-pc-windows-msvc | |
| archive: zip | |
| cargo_features: "" | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Free disk space (Ubuntu) | |
| if: runner.os == 'Linux' | |
| run: | | |
| sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc \ | |
| /usr/share/swift /usr/local/share/powershell /usr/local/share/chromium \ | |
| /usr/local/lib/node_modules /opt/hostedtoolcache/CodeQL | |
| sudo docker image prune --all --force || true | |
| df -h | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: ${{ matrix.target }} | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| key: release-${{ matrix.target }} | |
| cache-on-failure: true | |
| - name: Download driver jar | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: infigraph-driver | |
| - name: Build | |
| run: cargo build --release --target ${{ matrix.target }} -p infigraph-cli -p infigraph-mcp --features remote ${{ matrix.cargo_features }} | |
| - name: Sign (macOS) | |
| if: runner.os == 'macOS' | |
| run: | | |
| codesign --force --deep --sign - target/${{ matrix.target }}/release/infigraph | |
| codesign --force --deep --sign - target/${{ matrix.target }}/release/infigraph-mcp | |
| - name: Prepare grammar plugins | |
| shell: bash | |
| run: | | |
| rm -rf grammars_clean && mkdir -p grammars_clean | |
| for lang in grammars/*/; do | |
| name=$(basename "$lang") | |
| mkdir -p "grammars_clean/$name" | |
| cp "$lang"/*.g4 "grammars_clean/$name/" 2>/dev/null || true | |
| cp "$lang/plugin.toml" "grammars_clean/$name/" 2>/dev/null || true | |
| done | |
| - name: Package (unix) | |
| if: matrix.archive == 'tar.gz' | |
| run: | | |
| cp target/${{ matrix.target }}/release/infigraph . | |
| cp target/${{ matrix.target }}/release/infigraph-mcp . | |
| rm -rf grammars && mv grammars_clean grammars | |
| tar -czf infigraph-${{ matrix.target }}.tar.gz infigraph infigraph-mcp infigraph-driver.jar models/ grammars/ | |
| echo "ASSET=infigraph-${{ matrix.target }}.tar.gz" >> $GITHUB_ENV | |
| - name: Package (windows) | |
| if: matrix.archive == 'zip' | |
| shell: pwsh | |
| run: | | |
| Copy-Item target/${{ matrix.target }}/release/infigraph.exe . | |
| Copy-Item target/${{ matrix.target }}/release/infigraph-mcp.exe . | |
| Rename-Item grammars_clean grammars_pkg | |
| if (Test-Path grammars) { Remove-Item -Recurse grammars } | |
| Rename-Item grammars_pkg grammars | |
| Compress-Archive -Path infigraph.exe, infigraph-mcp.exe, infigraph-driver.jar, models/, grammars/ -DestinationPath infigraph-${{ matrix.target }}.zip | |
| echo "ASSET=infigraph-${{ matrix.target }}.zip" >> $env:GITHUB_ENV | |
| - name: Upload to release | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: gh release upload "${{ github.ref_name }}" "${{ env.ASSET }}" --clobber --repo "${{ github.repository }}" | |
| npm-publish: | |
| name: Publish npm packages | |
| needs: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| registry-url: 'https://registry.npmjs.org' | |
| - name: Download driver jar | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: infigraph-driver | |
| - name: Download release archives | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| TAG="${{ github.ref_name }}" | |
| mkdir -p /tmp/release-assets | |
| for target in aarch64-apple-darwin x86_64-apple-darwin x86_64-unknown-linux-gnu aarch64-unknown-linux-gnu; do | |
| gh release download "$TAG" --pattern "infigraph-${target}.tar.gz" --dir /tmp/release-assets --repo "${{ github.repository }}" | |
| done | |
| gh release download "$TAG" --pattern "infigraph-x86_64-pc-windows-msvc.zip" --dir /tmp/release-assets --repo "${{ github.repository }}" | |
| - name: Sync npm versions with tag | |
| run: | | |
| VERSION="${{ github.ref_name }}" | |
| VERSION="${VERSION#v}" | |
| # Update main package.json | |
| cd npm | |
| npm version "$VERSION" --no-git-tag-version --allow-same-version | |
| # Update optionalDependencies versions | |
| for platform in darwin-arm64 darwin-x64 linux-x64 linux-arm64 win32-x64; do | |
| sed -i "s|\"@intuit/infigraph-${platform}\": \".*\"|\"@intuit/infigraph-${platform}\": \"${VERSION}\"|" package.json | |
| done | |
| # Update platform package.json versions | |
| for platform in darwin-arm64 darwin-x64 linux-x64 linux-arm64 win32-x64; do | |
| cd platforms/${platform} | |
| npm version "$VERSION" --no-git-tag-version --allow-same-version | |
| cd ../.. | |
| done | |
| - name: Pack platform packages | |
| run: | | |
| set -euo pipefail | |
| declare -A PLATFORM_MAP=( | |
| ["aarch64-apple-darwin"]="darwin-arm64" | |
| ["x86_64-apple-darwin"]="darwin-x64" | |
| ["x86_64-unknown-linux-gnu"]="linux-x64" | |
| ["aarch64-unknown-linux-gnu"]="linux-arm64" | |
| ["x86_64-pc-windows-msvc"]="win32-x64" | |
| ) | |
| for target in "${!PLATFORM_MAP[@]}"; do | |
| platform="${PLATFORM_MAP[$target]}" | |
| dest="npm/platforms/${platform}/bin" | |
| rm -rf "$dest" | |
| mkdir -p "$dest" | |
| if [[ "$target" == *windows* ]]; then | |
| tmpdir=$(mktemp -d) | |
| unzip -o "/tmp/release-assets/infigraph-${target}.zip" -d "$tmpdir" | |
| cp "$tmpdir"/infigraph.exe "$dest/" | |
| cp "$tmpdir"/infigraph-mcp.exe "$dest/" | |
| [ -f "$tmpdir/infigraph-driver.jar" ] && cp "$tmpdir/infigraph-driver.jar" "$dest/" | |
| [ -d "$tmpdir/grammars" ] && cp -r "$tmpdir/grammars" "$dest/" | |
| [ -d "$tmpdir/models" ] && cp -r "$tmpdir/models" "$dest/" | |
| rm -rf "$tmpdir" | |
| else | |
| tar -xzf "/tmp/release-assets/infigraph-${target}.tar.gz" -C "$dest" | |
| fi | |
| # Driver jar from artifact (same for all platforms) | |
| [ -f infigraph-driver.jar ] && cp infigraph-driver.jar "$dest/" | |
| done | |
| - name: Publish platform packages | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| run: | | |
| for platform in darwin-arm64 darwin-x64 linux-x64 linux-arm64 win32-x64; do | |
| cd npm/platforms/${platform} | |
| npm publish --access public || echo "Platform ${platform} publish failed (may already exist)" | |
| cd "${{ github.workspace }}" | |
| done | |
| - name: Publish main package | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| working-directory: npm | |
| run: npm publish --access public |