Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
a0cbcf28fb | ||
![]() |
b73b6ee0ed |
37
.gitea/workflows/build-multi-plaform.yaml
Normal file
37
.gitea/workflows/build-multi-plaform.yaml
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
name: Build
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ main ]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: self-hosted
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Install Latest Go
|
||||||
|
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
|
||||||
|
|
||||||
|
- name: Checkout code
|
||||||
|
run: git clone https://your.gitea.server/user/repo.git .
|
||||||
|
|
||||||
|
- name: Build for Linux/Windows (amd64 + arm)
|
||||||
|
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
|
||||||
|
|
||||||
|
- name: List artifacts
|
||||||
|
run: ls -lh build
|
Reference in New Issue
Block a user