Files
hello_gitea/scripts/quick-build.sh
Anton Kuznetcov 75822f7fb8
Some checks failed
Release Build / create-release (push) Failing after 6m17s
Release Build / create-docker-image (push) Has been skipped
Release Build / update-to-release-branch (push) Has been skipped
Release v1.0.35
2025-07-28 17:33:06 +06:00

21 lines
591 B
Bash

#!/bin/bash
if [ ! -f go.mod ]; then
echo "go.mod not found in current directory"
exit 1
fi
# Проверяем, изменились ли зависимости
if [ ! -f go.sum ] || ! go mod verify >/dev/null 2>&1; then
echo "Dependencies changed, downloading..."
go mod download
fi
# Собираем для указанной платформы
if [ -n "$1" ] && [ -n "$2" ]; then
echo "Building for $1 $2..."
GOOS=$1 GOARCH=$2 go build -o "bin/hello-api-$1-$2" main.go
else
echo "Building for current platform..."
go build -o bin/hello-api main.go
fi