-
Notifications
You must be signed in to change notification settings - Fork 254
128 lines (123 loc) · 4.5 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
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
name: Build
on:
pull_request:
concurrency:
# Cancel any running workflow for the same branch when new commits are pushed.
# We group both by ref_name (available when CI is triggered by a push to a branch/tag)
# and head_ref (available when CI is triggered by a PR).
group: "${{ github.ref_name }}-${{ github.head_ref }}"
cancel-in-progress: true
jobs:
build_linux:
name: Build on Linux
runs-on: ubuntu-latest
container: grafana/alloy-build-image:v0.1.8
strategy:
matrix:
os: [linux]
arch: [amd64, arm64, ppc64le, s390x]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set ownership
# https://github.com/actions/runner/issues/2033#issuecomment-1204205989
run: |
# this is to fix GIT not liking owner of the checkout dir
chown -R $(id -u):$(id -g) $PWD
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
# TODO: Try enabling caching later. It might use up too much disk space on runners so needs extra testing.
cache: false
- run: make generate-ui
- run: GO_TAGS="builtinassets promtail_journal_enabled" GOOS=${{ matrix.os }} GOARCH=${{ matrix.arch }} GOARM= make alloy
build_linux_boringcrypto:
name: Build on Linux (boringcrypto)
runs-on: ubuntu-latest
container: grafana/alloy-build-image:v0.1.8-boringcrypto
strategy:
matrix:
os: [linux]
arch: [amd64, arm64]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set ownership
# https://github.com/actions/runner/issues/2033#issuecomment-1204205989
run: |
# this is to fix GIT not liking owner of the checkout dir
chown -R $(id -u):$(id -g) $PWD
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
# TODO: Try enabling caching later. It might use up too much disk space on runners so needs extra testing.
cache: false
- run: make generate-ui
- run: GO_TAGS="builtinassets promtail_journal_enabled" GOOS=${{ matrix.os }} GOARCH=${{ matrix.arch }} GOARM= GOEXPERIMENT=boringcrypto make alloy
build_mac_intel:
name: Build on MacOS (Intel)
runs-on: macos-14-large
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
# TODO: Try enabling caching later. It might use up too much disk space on runners so needs extra testing.
cache: false
- run: make generate-ui
- run: GO_TAGS="builtinassets" GOOS=darwin GOARCH=amd64 GOARM= make alloy
build_mac_arm:
name: Build on MacOS (ARM)
runs-on: macos-14-xlarge
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
# TODO: Try enabling caching later. It might use up too much disk space on runners so needs extra testing.
cache: false
- run: make generate-ui
- run: GO_TAGS="builtinassets" GOOS=darwin GOARCH=arm64 GOARM= make alloy
build_windows:
name: Build on Windows (AMD64)
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
# TODO: Try enabling caching later. It might use up too much disk space on runners so needs extra testing.
cache: false
- run: make generate-ui
- run: echo "GO_TAGS=builtinassets" | Out-File -FilePath $env:GITHUB_ENV -Append
- run: echo "GOOS=windows" | Out-File -FilePath $env:GITHUB_ENV -Append
- run: echo "GOARCH=amd64" | Out-File -FilePath $env:GITHUB_ENV -Append
- run: make alloy
build_freebsd:
name: Build on FreeBSD (AMD64)
runs-on: ubuntu-latest
container: grafana/alloy-build-image:v0.1.8
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set ownership
# https://github.com/actions/runner/issues/2033#issuecomment-1204205989
run: |
# this is to fix GIT not liking owner of the checkout dir
chown -R $(id -u):$(id -g) $PWD
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
# TODO: Try enabling caching later. It might use up too much disk space on runners so needs extra testing.
cache: false
- run: make generate-ui
- run: GO_TAGS="builtinassets" GOOS=freebsd GOARCH=amd64 GOARM= make alloy