#!/bin/bash
set -euo pipefail

APP=urlcrawler
DIST_DIR=dist

rm -rf "$DIST_DIR"
mkdir -p "$DIST_DIR"

echo "Building $APP for darwin/amd64..."
GOOS=darwin GOARCH=amd64 go build -o "$DIST_DIR/${APP}-darwin-amd64"

echo "Building $APP for darwin/arm64..."
GOOS=darwin GOARCH=arm64 go build -o "$DIST_DIR/${APP}-darwin-arm64"

echo "Building $APP for linux/amd64..."
GOOS=linux GOARCH=amd64 go build -o "$DIST_DIR/${APP}-linux-amd64"

echo "Building $APP for linux/arm64..."
GOOS=linux GOARCH=arm64 go build -o "$DIST_DIR/${APP}-linux-arm64"

echo "Done. Artifacts in $DIST_DIR/"


