-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (38 loc) · 1022 Bytes
/
Copy pathcommit.yaml
File metadata and controls
45 lines (38 loc) · 1022 Bytes
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
name: Build on commit
on:
push:
branches:
- '*'
jobs:
build:
name: Build Release Assets
runs-on: ubuntu-latest
strategy:
matrix:
os: [linux, windows, darwin]
arch: [amd64, arm64, 386]
binaryname: [ldapconsole]
# Exclude incompatible couple of GOOS and GOARCH values
exclude:
- os: darwin
arch: 386
env:
GO111MODULE: 'on'
CGO_ENABLED: '0'
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.22.1'
- name: Build Binary
env:
GOOS: ${{ matrix.os }}
GOARCH: ${{ matrix.arch }}
run: |
mkdir -p build
ls -lha
OUTPUT_PATH="build/${{ matrix.binaryname }}-${{ matrix.os }}-${{ matrix.arch }}"
# Build the binary
go build -ldflags="-s -w" -o $OUTPUT_PATH${{ matrix.os == 'windows' && '.exe' || '' }}