-
Notifications
You must be signed in to change notification settings - Fork 0
95 lines (81 loc) · 2.5 KB
/
release.yaml
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
name: Create Release
on:
push:
tags:
- 'v*'
jobs:
build-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
persist-credentials: true
- uses: bufbuild/buf-setup-action@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.21.4'
- name: Build Binary for Linux
run: |
make build GOARCH=amd64
tar -czvf "lda-linux-amd64.tar.gz" "lda"
make build GOARCH=arm64
tar -czvf "lda-linux-arm64.tar.gz" "lda"
- uses: actions/upload-artifact@v4
with:
name: lda-linux-amd64.tar.gz
path: lda-linux-amd64.tar.gz
- uses: actions/upload-artifact@v4
with:
name: lda-linux-arm64.tar.gz
path: lda-linux-arm64.tar.gz
build-macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
persist-credentials: true
- uses: bufbuild/buf-setup-action@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.21.4'
- name: Build Binary for macOS
run: |
make build GOARCH=amd64
tar -czvf "lda-darwin-amd64.tar.gz" "lda"
make build GOARCH=arm64
tar -czvf "lda-darwin-arm64.tar.gz" "lda"
- uses: actions/upload-artifact@v4
with:
name: lda-darwin-amd64.tar.gz
path: lda-darwin-amd64.tar.gz
- uses: actions/upload-artifact@v4
with:
name: lda-darwin-arm64.tar.gz
path: lda-darwin-arm64.tar.gz
create-release:
needs: [build-linux, build-macos]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts/
- name: Create Release
uses: softprops/action-gh-release@v2
with:
files: |
artifacts/lda-darwin-arm64.tar.gz/lda-darwin-arm64.tar.gz
artifacts/lda-darwin-amd64.tar.gz/lda-darwin-amd64.tar.gz
artifacts/lda-linux-amd64.tar.gz/lda-linux-amd64.tar.gz
artifacts/lda-linux-arm64.tar.gz/lda-linux-arm64.tar.gz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}