windows build err fix (#3) #4
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*.*.*" | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| build: | |
| name: Build ${{ matrix.name }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - target: x86_64-unknown-linux-gnu | |
| os: ubuntu-latest | |
| name: clawd-linux-amd64 | |
| cross: false | |
| - target: aarch64-unknown-linux-gnu | |
| os: ubuntu-latest | |
| name: clawd-linux-arm64 | |
| cross: true | |
| - target: x86_64-pc-windows-msvc | |
| os: windows-latest | |
| name: clawd-windows-amd64.exe | |
| cross: false | |
| - target: aarch64-pc-windows-msvc | |
| os: windows-latest | |
| name: clawd-windows-arm64.exe | |
| cross: false | |
| - target: x86_64-apple-darwin | |
| os: macos-13 | |
| name: clawd-darwin-amd64 | |
| cross: false | |
| - target: aarch64-apple-darwin | |
| os: macos-latest | |
| name: clawd-darwin-arm64 | |
| cross: false | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: ${{ matrix.target }} | |
| - name: Setup Rust Cache | |
| uses: Swatinem/rust-cache@v2 | |
| with: | |
| workspaces: cli -> target | |
| key: ${{ matrix.target }} | |
| - name: Install cross (Linux ARM64) | |
| if: matrix.cross | |
| run: cargo install cross --git https://github.com/cross-rs/cross | |
| - name: Build (native) | |
| if: ${{ !matrix.cross }} | |
| working-directory: cli | |
| run: cargo build --release --target ${{ matrix.target }} | |
| - name: Build (cross) | |
| if: matrix.cross | |
| working-directory: cli | |
| run: cross build --release --target ${{ matrix.target }} | |
| - name: Rename binary (Unix) | |
| if: runner.os != 'Windows' | |
| run: | | |
| cp cli/target/${{ matrix.target }}/release/clawd ${{ matrix.name }} | |
| - name: Rename binary (Windows) | |
| if: runner.os == 'Windows' | |
| run: | | |
| cp cli/target/${{ matrix.target }}/release/clawd.exe ${{ matrix.name }} | |
| - name: Generate SHA256 checksum (Unix) | |
| if: runner.os != 'Windows' | |
| run: | | |
| shasum -a 256 ${{ matrix.name }} > ${{ matrix.name }}.sha256 | |
| - name: Generate SHA256 checksum (Windows) | |
| if: runner.os == 'Windows' | |
| run: | | |
| (Get-FileHash -Algorithm SHA256 ${{ matrix.name }}).Hash.ToLower() + " " + "${{ matrix.name }}" | Out-File -Encoding ASCII ${{ matrix.name }}.sha256 | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.name }} | |
| path: | | |
| ${{ matrix.name }} | |
| ${{ matrix.name }}.sha256 | |
| if-no-files-found: error | |
| release: | |
| name: Create Release | |
| needs: build | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: artifacts | |
| - name: Collect binaries | |
| run: | | |
| mkdir -p release | |
| find artifacts -type f -exec mv {} release/ \; | |
| ls -la release/ | |
| - name: Create combined checksums file | |
| run: | | |
| cd release | |
| cat *.sha256 > checksums.sha256 | |
| cat checksums.sha256 | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: release/* | |
| generate_release_notes: true | |
| fail_on_unmatched_files: true |