Update README.md #6
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: CI Build | |
| on: | |
| push: | |
| branches: | |
| - "**" | |
| pull_request: | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| env: | |
| BINARY_NAME: geekpie | |
| PACKAGE_NAME: geekpie-code | |
| jobs: | |
| build: | |
| name: Build ${{ matrix.label }} | |
| runs-on: ${{ matrix.runner }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - label: linux-x64 | |
| runner: ubuntu-latest | |
| target: x86_64-unknown-linux-gnu | |
| - label: linux-arm64 | |
| runner: ubuntu-24.04-arm | |
| target: aarch64-unknown-linux-gnu | |
| - label: macos-x64 | |
| runner: macos-14 | |
| target: x86_64-apple-darwin | |
| - label: macos-arm64 | |
| runner: macos-14 | |
| target: aarch64-apple-darwin | |
| - label: windows-x64 | |
| runner: windows-latest | |
| target: x86_64-pc-windows-msvc | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: ${{ matrix.target }} | |
| - name: Restore Cargo cache | |
| uses: Swatinem/rust-cache@v2 | |
| with: | |
| workspaces: rust -> target | |
| - name: Build release binary | |
| working-directory: rust | |
| run: cargo build --release --locked -p rusty-claude-cli --target ${{ matrix.target }} | |
| - name: Package binary (Unix) | |
| if: runner.os != 'Windows' | |
| id: package_unix | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| mkdir -p dist | |
| cp "rust/target/${{ matrix.target }}/release/${BINARY_NAME}" "dist/${BINARY_NAME}" | |
| archive="${PACKAGE_NAME}-${{ matrix.target }}.tar.gz" | |
| tar -C dist -czf "$archive" "${BINARY_NAME}" | |
| echo "asset=$archive" >> "$GITHUB_OUTPUT" | |
| - name: Package binary (Windows) | |
| if: runner.os == 'Windows' | |
| id: package_windows | |
| shell: pwsh | |
| run: | | |
| New-Item -ItemType Directory -Force -Path dist | Out-Null | |
| Copy-Item "rust/target/${{ matrix.target }}/release/$env:BINARY_NAME.exe" "dist/$env:BINARY_NAME.exe" -Force | |
| $archive = "$env:PACKAGE_NAME-${{ matrix.target }}.zip" | |
| Compress-Archive -Path "dist/$env:BINARY_NAME.exe" -DestinationPath $archive -Force | |
| "asset=$archive" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append | |
| - name: Upload packaged artifact (Unix) | |
| if: runner.os != 'Windows' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ci-${{ matrix.label }} | |
| path: ${{ steps.package_unix.outputs.asset }} | |
| if-no-files-found: error | |
| retention-days: 7 | |
| - name: Upload packaged artifact (Windows) | |
| if: runner.os == 'Windows' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ci-${{ matrix.label }} | |
| path: ${{ steps.package_windows.outputs.asset }} | |
| if-no-files-found: error | |
| retention-days: 7 |