-
Notifications
You must be signed in to change notification settings - Fork 5
66 lines (65 loc) · 2.11 KB
/
build-and-release.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
name: Build and Release
permissions:
contents: write
on:
push:
tags:
- v*
jobs:
build:
name: Build
runs-on: ubuntu-20.04
strategy:
matrix:
platform: [darwin, linux, windows]
arch: [amd64, arm64]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: 1.21
- name: Install dependencies
run: go get .
- name: Build Binary
run: GOOS=${{ matrix.platform }} GOARCH=${{ matrix.arch }} go build -o cbdinocluster-${{ matrix.platform }}-${{ matrix.arch }} -ldflags="-X github.com/couchbaselabs/cbdinocluster/contrib/buildversion.MainPkgVersion=${{ github.ref_name }}"
- uses: actions/upload-artifact@v3
with:
name: cbdinocluster-${{ matrix.platform }}-${{ matrix.arch }}
path: cbdinocluster-${{ matrix.platform }}-${{ matrix.arch }}
publish:
name: Publish
needs: [build]
runs-on: ubuntu-20.04
steps:
- uses: actions/download-artifact@v3
with:
name: cbdinocluster-linux-amd64
- uses: actions/download-artifact@v3
with:
name: cbdinocluster-linux-arm64
- uses: actions/download-artifact@v3
with:
name: cbdinocluster-darwin-amd64
- uses: actions/download-artifact@v3
with:
name: cbdinocluster-darwin-arm64
- uses: actions/download-artifact@v3
with:
name: cbdinocluster-windows-amd64
- uses: actions/download-artifact@v3
with:
name: cbdinocluster-windows-arm64
- name: Rename Windows Amd64 Binary
run: mv cbdinocluster-windows-amd64 cbdinocluster-windows-amd64.exe
- name: Rename Windows Arm64 Binary
run: mv cbdinocluster-windows-arm64 cbdinocluster-windows-arm64.exe
- name: Release
uses: softprops/action-gh-release@v1
with:
files: |
cbdinocluster-darwin-amd64
cbdinocluster-darwin-arm64
cbdinocluster-linux-amd64
cbdinocluster-linux-arm64
cbdinocluster-windows-amd64.exe
cbdinocluster-windows-arm64.exe