Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
d1c63de5d1 | |||
9e431a00ce | |||
75822f7fb8 |
@@ -31,36 +31,52 @@ jobs:
|
|||||||
cd hello_gitea
|
cd hello_gitea
|
||||||
mkdir -p bin
|
mkdir -p bin
|
||||||
echo "Building for all platforms..."
|
echo "Building for all platforms..."
|
||||||
|
|
||||||
|
mv usr/local/bin/quick-build quick-build.sh
|
||||||
|
chmod +x quick-build.sh
|
||||||
|
|
||||||
# Build for all platforms
|
# Build for all platforms
|
||||||
echo "Building for linux amd64..."
|
echo "Building for linux amd64..."
|
||||||
quick-build linux amd64
|
quick-build.sh linux amd64
|
||||||
echo "Building for linux arm64..."
|
|
||||||
quick-build linux arm64
|
|
||||||
echo "Building for windows amd64..."
|
|
||||||
quick-build windows amd64
|
|
||||||
echo "Building for darwin amd64..."
|
|
||||||
quick-build darwin amd64
|
|
||||||
echo "Building for darwin arm64..."
|
|
||||||
quick-build darwin arm64
|
|
||||||
|
|
||||||
# Build for all platforms - old variant
|
echo "Building for linux arm64..."
|
||||||
# GOOS=linux GOARCH=amd64 go build -o bin/hello-api-linux-amd64 main.go
|
quick-build.sh linux arm64
|
||||||
# GOOS=linux GOARCH=arm64 go build -o bin/hello-api-linux-arm64 main.go
|
|
||||||
# GOOS=windows GOARCH=amd64 go build -o bin/hello-api-windows-amd64.exe main.go
|
echo "Building for windows amd64..."
|
||||||
# GOOS=darwin GOARCH=amd64 go build -o bin/hello-api-darwin-amd64 main.go
|
quick-build.sh windows amd64
|
||||||
# GOOS=darwin GOARCH=arm64 go build -o bin/hello-api-darwin-arm64 main.go
|
|
||||||
|
echo "Building for darwin amd64..."
|
||||||
|
quick-build.sh darwin amd64
|
||||||
|
|
||||||
|
echo "Building for darwin arm64..."
|
||||||
|
quick-build.sh darwin arm64
|
||||||
|
|
||||||
|
echo "Listing bin directory..."
|
||||||
|
ls -la bin
|
||||||
|
|
||||||
# Create archives
|
# Create archives
|
||||||
echo "Creating archives..."
|
echo "Creating archives..."
|
||||||
cd bin
|
cd bin
|
||||||
|
|
||||||
|
# Create archives with correct file names
|
||||||
|
echo "Creating archives for linux amd64..."
|
||||||
tar -czf hello-api-linux-amd64.tar.gz hello-api-linux-amd64
|
tar -czf hello-api-linux-amd64.tar.gz hello-api-linux-amd64
|
||||||
|
|
||||||
|
echo "Creating archives for linux arm64..."
|
||||||
tar -czf hello-api-linux-arm64.tar.gz hello-api-linux-arm64
|
tar -czf hello-api-linux-arm64.tar.gz hello-api-linux-arm64
|
||||||
|
|
||||||
|
echo "Creating archives for windows amd64..."
|
||||||
|
mv hello-api-windows-amd64 hello-api-windows-amd64.exe
|
||||||
tar -czf hello-api-windows-amd64.tar.gz hello-api-windows-amd64.exe
|
tar -czf hello-api-windows-amd64.tar.gz hello-api-windows-amd64.exe
|
||||||
|
|
||||||
|
echo "Creating archives for darwin amd64..."
|
||||||
tar -czf hello-api-darwin-amd64.tar.gz hello-api-darwin-amd64
|
tar -czf hello-api-darwin-amd64.tar.gz hello-api-darwin-amd64
|
||||||
|
|
||||||
|
echo "Creating archives for darwin arm64..."
|
||||||
tar -czf hello-api-darwin-arm64.tar.gz hello-api-darwin-arm64
|
tar -czf hello-api-darwin-arm64.tar.gz hello-api-darwin-arm64
|
||||||
|
|
||||||
echo "Listing bin directory..."
|
echo "Listing bin directory again ..."
|
||||||
ls -la bin
|
ls -la
|
||||||
|
|
||||||
- name: Create Release
|
- name: Create Release
|
||||||
run: |
|
run: |
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
# Build stage
|
# Build stage
|
||||||
FROM --platform=$BUILDPLATFORM golang:1.21-alpine AS builder
|
FROM --platform=$BUILDPLATFORM golang:1.24-alpine AS builder
|
||||||
|
|
||||||
# Install git and ca-certificates
|
# Install git and ca-certificates
|
||||||
RUN apk --no-cache add git ca-certificates
|
RUN apk --no-cache add git ca-certificates
|
||||||
|
2
go.mod
2
go.mod
@@ -1,6 +1,6 @@
|
|||||||
module direct-dev-ru/hello_gitea
|
module direct-dev-ru/hello_gitea
|
||||||
|
|
||||||
go 1.21
|
go 1.24
|
||||||
|
|
||||||
require github.com/gin-gonic/gin v1.10.1
|
require github.com/gin-gonic/gin v1.10.1
|
||||||
|
|
||||||
|
2
main.go
2
main.go
@@ -11,7 +11,7 @@ import (
|
|||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
)
|
)
|
||||||
|
|
||||||
const version = "1.0.34"
|
const version = "1.0.37"
|
||||||
|
|
||||||
// SystemInfo holds system information
|
// SystemInfo holds system information
|
||||||
type SystemInfo struct {
|
type SystemInfo struct {
|
||||||
|
2
makefile
2
makefile
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
BIN_DIR=bin
|
BIN_DIR=bin
|
||||||
APP_NAME=hello-api
|
APP_NAME=hello-api
|
||||||
VERSION=1.0.34
|
VERSION=1.0.37
|
||||||
|
|
||||||
build:
|
build:
|
||||||
mkdir -p $(BIN_DIR)
|
mkdir -p $(BIN_DIR)
|
||||||
|
@@ -13,7 +13,9 @@ fi
|
|||||||
|
|
||||||
# Собираем для указанной платформы
|
# Собираем для указанной платформы
|
||||||
if [ -n "$1" ] && [ -n "$2" ]; then
|
if [ -n "$1" ] && [ -n "$2" ]; then
|
||||||
GOOS=$1 GOARCH=$2 go build -o "hello-api-$1-$2" main.go
|
echo "Building for $1 $2..."
|
||||||
|
GOOS=$1 GOARCH=$2 go build -o "bin/hello-api-$1-$2" main.go
|
||||||
else
|
else
|
||||||
go build -o hello-api main.go
|
echo "Building for current platform..."
|
||||||
|
go build -o bin/hello-api main.go
|
||||||
fi
|
fi
|
Reference in New Issue
Block a user