Skip to content

Commit 3850010

Browse files
committed
add basic build
1 parent 2d13cc5 commit 3850010

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

.github/workflows/build-app.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
on:
2+
push:
3+
branches:
4+
- autobuild-test
5+
6+
jobs:
7+
build:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v4
11+
- name: Setup Go
12+
uses: actions/setup-go@v5
13+
with:
14+
go-version: '1.21.x'
15+
- name: Install dependencies
16+
run: go get .
17+
- name: Build
18+
run: sh ./build.sh
19+
- name: Upload builds
20+
uses: actions/upload-artifact@v4
21+
with:
22+
pattern: anchor-*
23+
path: ./bin/*

build.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/sh
2+
3+
go get .
4+
5+
#build for all platforms
6+
platforms=("windows/amd64" "linux/amd64" "darwin/amd64" "darwin/arm64" "linux/arm64" "windows/amd64")
7+
for platform in "${platforms[@]}"; do
8+
GOOS=${platform%/*}
9+
GOARCH=${platform#*/}
10+
env GOOS=$GOOS GOARCH=$GOARCH go build -v -o ./bin/anchor-$GOOS-$GOARCH .
11+
done

0 commit comments

Comments
 (0)