Skip to content

Commit 181dec5

Browse files
committed
Add autobuild gitaction
1 parent 2d13cc5 commit 181dec5

File tree

2 files changed

+47
-0
lines changed

2 files changed

+47
-0
lines changed

.github/workflows/build-app.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Build App
2+
3+
on:
4+
push:
5+
branches:
6+
- autobuild3
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
13+
- name: Checkout
14+
uses: actions/checkout@v4
15+
with:
16+
ref: autobuild3
17+
18+
- name: Setup Go
19+
uses: actions/setup-go@v5
20+
with:
21+
go-version: '1.21.x'
22+
23+
- name: Install dependencies
24+
run: go get .
25+
26+
- name: Build
27+
run: |
28+
chmod +x ./build.sh
29+
./build.sh
30+
31+
- name: Upload builds
32+
uses: svenstaro/upload-release-action@v2
33+
with:
34+
repo_token: ${{ secrets.GITHUB_TOKEN }}
35+
file: ./bin/anchor-*
36+
file_glob: true
37+
tag: ${{ github.ref }}
38+
target_commit: autobuild3

build.sh

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

0 commit comments

Comments
 (0)