v1.5.0 #12
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: ai-codespark-release | |
| on: | |
| release: | |
| types: | |
| - created | |
| jobs: | |
| build: | |
| strategy: | |
| matrix: | |
| include: | |
| - os: ubuntu-latest | |
| platform: linux | |
| arch: x64 | |
| ubuntu_version: "20.04" | |
| - os: ubuntu-latest | |
| platform: linux | |
| arch: x64 | |
| ubuntu_version: "22.04" | |
| - os: ubuntu-latest | |
| platform: linux | |
| arch: x64 | |
| ubuntu_version: "24.04" | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| registry-url: 'https://registry.npmjs.org' | |
| - name: Build | |
| run: | | |
| # Install Claude Code from npm | |
| npm install -g @anthropic-ai/claude-code | |
| # Verify initial installation | |
| which claude | |
| claude --version | |
| # Use claude install --force latest to get the binary executable | |
| echo "Running 'claude install --force latest' to get binary executable..." | |
| claude install --force latest | |
| # Find where the binary executable is located after install | |
| # Check common locations where claude install might place the binary | |
| BINARY_LOCATIONS=( | |
| "$HOME/.local/bin/claude" | |
| "$HOME/.claude/bin/claude" | |
| "$HOME/bin/claude" | |
| "/usr/local/bin/claude" | |
| "$(which claude)" | |
| ) | |
| CLAUDE_BINARY="" | |
| for location in "${BINARY_LOCATIONS[@]}"; do | |
| if [ -f "$location" ] && [ -x "$location" ]; then | |
| echo "Found claude binary at: $location" | |
| CLAUDE_BINARY="$location" | |
| break | |
| fi | |
| done | |
| if [ -z "$CLAUDE_BINARY" ]; then | |
| echo "Could not find claude binary after install. Searching..." | |
| find $HOME -name "claude" -type f -executable 2>/dev/null | head -5 | |
| # Fallback to the npm installed version if binary not found | |
| CLAUDE_BINARY=$(which claude) | |
| fi | |
| echo "Using claude binary at: $CLAUDE_BINARY" | |
| # Verify the binary works | |
| "$CLAUDE_BINARY" --version | |
| # Create artifacts directory | |
| mkdir -p artifacts | |
| # Copy claude binary to artifacts with platform-specific name | |
| cp "$CLAUDE_BINARY" artifacts/claude-${{ matrix.platform }}-${{ matrix.arch }}-ubuntu${{ matrix.ubuntu_version }} | |
| chmod +x artifacts/claude-${{ matrix.platform }}-${{ matrix.arch }}-ubuntu${{ matrix.ubuntu_version }} | |
| # Verify the copied binary works | |
| ./artifacts/claude-${{ matrix.platform }}-${{ matrix.arch }}-ubuntu${{ matrix.ubuntu_version }} --version | |
| echo "Claude binary built successfully for ${{ matrix.platform }}-${{ matrix.arch }}-ubuntu${{ matrix.ubuntu_version }}" | |
| - name: Upload | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: claude-${{ matrix.platform }}-${{ matrix.arch }}-ubuntu${{ matrix.ubuntu_version }} | |
| path: artifacts/claude-${{ matrix.platform }}-${{ matrix.arch }}-ubuntu${{ matrix.ubuntu_version }} | |
| release: | |
| permissions: | |
| contents: write | |
| runs-on: ubuntu-latest | |
| needs: | |
| - build | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Git | |
| run: | | |
| git config --local user.email "action@github.com" | |
| git config --local user.name "GitHub Action" | |
| - name: Download | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: artifacts/ | |
| pattern: claude-* | |
| merge-multiple: true | |
| - name: Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ github.ref_name }} | |
| token: ${{ secrets.AI_CODESPARK_TOKEN }} | |
| files: | | |
| artifacts/claude-* |