diff --git a/.gitea/workflows/build-multi-plaform.yaml b/.gitea/workflows/build-multi-plaform.yaml index 7096a01..f481d49 100644 --- a/.gitea/workflows/build-multi-plaform.yaml +++ b/.gitea/workflows/build-multi-plaform.yaml @@ -1,37 +1,40 @@ -name: Build +name: Build Go Multi-Platform on: push: - branches: [ main ] + branches: + - main jobs: build: - runs-on: self-hosted + runs-on: ubuntu-latest 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: | - GO_VERSION=$(curl -s https://go.dev/VERSION?m=text) - 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 + GOOS=windows GOARCH=amd64 go build -o build/myapp-windows-amd64.exe ./... - - name: Checkout code - run: git clone https://your.gitea.server/user/repo.git . - - - name: Build for Linux/Windows (amd64 + arm) + - name: Build for Linux amd64 run: | - mkdir -p build - 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 + GOOS=linux GOARCH=amd64 go build -o build/myapp-linux-amd64 ./... - - name: List artifacts - run: ls -lh build + - 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