-
Notifications
You must be signed in to change notification settings - Fork 1
74 lines (64 loc) · 2.16 KB
/
go.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: Build Binaries
on:
release:
types: [published]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
arch: [amd64, arm64]
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: '1.23'
- name: Build for Linux amd64
if: matrix.os == 'ubuntu-latest' && matrix.arch == 'amd64'
run: |
cd cmd/varunastra
GOOS=linux GOARCH=amd64 go build -o varunastra .
zip varunastra_linux_amd64.zip varunastra
- name: Build for Linux arm64
if: matrix.os == 'ubuntu-latest' && matrix.arch == 'arm64'
run: |
cd cmd/varunastra
GOOS=linux GOARCH=arm64 go build -o varunastra .
zip varunastra_linux_arm64.zip varunastra
- name: Build for macOS arm64
if: matrix.os == 'macos-latest' && matrix.arch == 'arm64'
run: |
cd cmd/varunastra
GOOS=darwin GOARCH=arm64 go build -o varunastra .
zip varunastra_darwin_arm64.zip varunastra
- name: Upload binaries as artifacts
uses: actions/upload-artifact@v2
with:
name: varunastra-binaries
path: |
${{github.workspace}}/cmd/varunastra/varunastra_linux_amd64.zip
${{github.workspace}}/cmd/varunastra/varunastra_linux_arm64.zip
${{github.workspace}}/cmd/varunastra/varunastra_darwin_amd64.zip
${{github.workspace}}/cmd/varunastra/varunastra_darwin_arm64.zip
upload:
runs-on: ubuntu-latest
needs: build
steps:
- name: Download binaries
uses: actions/download-artifact@v2
with:
name: varunastra-binaries
- name: Upload binaries to release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.event.release.tag_name }}
files: |
varunastra_linux_amd64.zip
varunastra_linux_arm64.zip
varunastra_darwin_amd64.zip
varunastra_darwin_arm64.zip