1 Commits

Author SHA1 Message Date
Adrian Zürcher
a770875e2a another try change chckout repo 2025-08-04 17:18:00 +02:00

View File

@@ -1,37 +1,40 @@
name: Build name: Build Go Multi-Platform
on: on:
push: push:
branches: [ main ] branches:
- main
jobs: jobs:
build: build:
runs-on: self-hosted runs-on: ubuntu-latest
steps: steps:
- name: Install Latest Go - name: Checkout repository
run: | run: |
GO_VERSION=$(curl -s https://go.dev/VERSION?m=text) git clone https://gitea.tecamino.com/paadi/tecamino-proccessSupervisor.git .
wget https://go.dev/dl/${GO_VERSION}.linux-amd64.tar.gz
sudo rm -rf /usr/local/go
sudo tar -C /usr/local -xzf ${GO_VERSION}.linux-amd64.tar.gz
export PATH=/usr/local/go/bin:$PATH
echo "Go version installed:"
go version
- name: Checkout code - name: Set up Go
run: git clone https://your.gitea.server/user/repo.git . uses: actions/setup-go@v4
with:
go-version: 'stable'
- name: Build for Linux/Windows (amd64 + arm) - name: Build for Windows amd64
run: | run: |
mkdir -p build GOOS=windows GOARCH=amd64 go build -o build/myapp-windows-amd64.exe ./...
for GOOS in linux windows; do
for GOARCH in amd64 arm64; do
OUT=build/app-${GOOS}-${GOARCH}
[[ $GOOS == "windows" ]] && OUT="${OUT}.exe"
GOOS=$GOOS GOARCH=$GOARCH go build -o $OUT .
done
done
- name: List artifacts - name: Build for Linux amd64
run: ls -lh build run: |
GOOS=linux GOARCH=amd64 go build -o build/myapp-linux-amd64 ./...
- name: Build for Linux ARM64
run: |
GOOS=linux GOARCH=arm64 go build -o build/myapp-linux-arm64 ./...
- name: Build for Linux ARMv6 (Raspberry Pi)
run: |
GOOS=linux GOARCH=arm GOARM=6 go build -o build/myapp-linux-armv6 ./...
- name: List build artifacts
run: |
ls -lh build