another try change chckout repo
This commit is contained in:
@@ -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: |
|
||||||
|
git clone https://gitea.tecamino.com/paadi/tecamino-proccessSupervisor.git .
|
||||||
|
|
||||||
|
- name: Set up Go
|
||||||
|
uses: actions/setup-go@v4
|
||||||
|
with:
|
||||||
|
go-version: 'stable'
|
||||||
|
|
||||||
|
- name: Build for Windows amd64
|
||||||
run: |
|
run: |
|
||||||
GO_VERSION=$(curl -s https://go.dev/VERSION?m=text)
|
GOOS=windows GOARCH=amd64 go build -o build/myapp-windows-amd64.exe ./...
|
||||||
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: Build for Linux amd64
|
||||||
run: git clone https://your.gitea.server/user/repo.git .
|
|
||||||
|
|
||||||
- name: Build for Linux/Windows (amd64 + arm)
|
|
||||||
run: |
|
run: |
|
||||||
mkdir -p build
|
GOOS=linux GOARCH=amd64 go build -o build/myapp-linux-amd64 ./...
|
||||||
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 ARM64
|
||||||
run: ls -lh build
|
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
|
||||||
|
Reference in New Issue
Block a user