-
Notifications
You must be signed in to change notification settings - Fork 18
55 lines (47 loc) · 1.79 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: Build
on:
workflow_dispatch:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.20"
check-latest: true
- name: Cross Compile
run: |
mkdir bin
GOOS=linux GOARCH=amd64 go build -o ./bin/geo-linux-amd64 ./cmd/geo
GOOS=linux GOARCH=arm64 go build -o ./bin/geo-linux-arm64 ./cmd/geo
GOOS=linux GOARCH=arm GOARM=7 go build -o ./bin/geo-linux-armv7 ./cmd/geo
GOOS=darwin GOARCH=amd64 go build -o ./bin/geo-macos-amd64 ./cmd/geo
GOOS=darwin GOARCH=arm64 go build -o ./bin/geo-macos-arm64 ./cmd/geo
GOOS=windows GOARCH=amd64 go build -o ./bin/geo-windows-amd64.exe ./cmd/geo
GOOS=windows GOARCH=arm64 go build -o ./bin/geo-windows-arm64.exe ./cmd/geo
- uses: dev-drprasad/[email protected] # PRERELEASE is v1.0 and can also be used to test and give us feedback
with:
tag_name: latest
github_token: ${{ secrets.GITHUB_TOKEN }} # (required) a GitHub token with write access to the repo that needs to be modified
delete_release: true #(optional) default: true
# repo: <owner>/<repoName> #(optional) target repository. default: repo running this action
- name: Tag latest
run: |
git tag latest
git push origin latest
- name: Create and Upload Release
id: upload_release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
release_name: "α"
tag: latest
file_glob: true
overwrite: true
file: ./bin/*