| 1 | #!/bin/bash |
| 2 | set -e |
| 3 | |
| 4 | echo "Building kubo for all platforms in .github/build-platforms.yml..." |
| 5 | |
| 6 | if [ ! -f .github/build-platforms.yml ]; then |
| 7 | echo "Error: .github/build-platforms.yml not found" |
| 8 | exit 1 |
| 9 | fi |
| 10 | |
| 11 | grep '^ - ' .github/build-platforms.yml | sed 's/^ - //' | while read -r platform; do |
| 12 | if [ -z "$platform" ]; then |
| 13 | continue |
| 14 | fi |
| 15 | |
| 16 | GOOS=$(echo "$platform" | cut -d- -f1) |
| 17 | GOARCH=$(echo "$platform" | cut -d- -f2) |
| 18 | |
| 19 | echo "Building $platform..." |
| 20 | echo " GOOS=$GOOS GOARCH=$GOARCH go build -o /dev/null ./cmd/ipfs" |
| 21 | GOOS=$GOOS GOARCH=$GOARCH go build -o /dev/null ./cmd/ipfs |
| 22 | done |
| 23 | |
| 24 | echo "All platforms built successfully" |