Skip to content

Commit 3dcf4e1

Browse files
authored
Update build-updater.yaml
1 parent 1a4dc04 commit 3dcf4e1

1 file changed

Lines changed: 30 additions & 25 deletions

File tree

.github/workflows/build-updater.yaml

Lines changed: 30 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,17 @@ name: Build updater
22

33
on:
44
workflow_dispatch:
5+
pull_request:
6+
paths:
7+
- updater/**
58

69
jobs:
7-
build-backend-linux:
10+
build-updater-linux:
811
name: "Build updater for linux"
912
runs-on: ubuntu-latest
1013

11-
# Runs on alpine because it is easier to statically link the library
1214
container:
13-
image: golang:alpine
15+
image: golang:alpine
1416

1517
env:
1618
UPDATER_DIR: ./updater
@@ -25,7 +27,7 @@ jobs:
2527

2628
- name: "Create output path"
2729
working-directory: "${{env.UPDATER_DIR}}"
28-
run: mkdir ./output
30+
run: mkdir -p ./output
2931

3032
- name: "Build (64 bit)"
3133
working-directory: "${{env.UPDATER_DIR}}"
@@ -34,17 +36,17 @@ jobs:
3436
GOARCH: amd64
3537
GOOS: linux
3638
run: |
37-
go build -ldflags '-linkmode external -extldflags "-static"' -o ../output/updaters/updater-linux-64
39+
go build -ldflags '-linkmode external -extldflags "-static"' -o output/updater-linux-64
3840
3941
- name: "Upload build"
4042
uses: actions/upload-artifact@v4
4143
with:
4244
name: updater-linux
43-
path: "${{env.UPDATER_DIR}}/output/updaters/*"
45+
path: "${{env.UPDATER_DIR}}/output/*"
4446
retention-days: 3
4547
compression-level: 9
4648

47-
build-backend-windows:
49+
build-updater-windows:
4850
name: "Build updater for windows"
4951
runs-on: windows-latest
5052

@@ -71,58 +73,61 @@ jobs:
7173
GOARCH: amd64
7274
GOOS: windows
7375
run: |
74-
go build -o ..\output\updaters\backend-windows-64.exe
76+
go build -o output\\updater-windows-64.exe
7577
7678
- name: "Upload build"
7779
uses: actions/upload-artifact@v4
7880
with:
7981
name: updater-windows
80-
path: "${{env.UPDATER_DIR}}\\output\\updaters\\*"
82+
path: "${{env.UPDATER_DIR}}\\output\\*"
8183
retention-days: 3
8284
compression-level: 9
83-
84-
build-backend-mac:
85+
86+
build-updater-mac:
8587
name: "Build updater for macOS"
8688
runs-on: macos-latest
87-
89+
8890
env:
89-
BACKEND_DIR: ./updater
90-
91+
UPDATER_DIR: ./updater
92+
9193
steps:
94+
- name: "Install packages"
95+
run: brew install libpcap || true
96+
9297
- name: "Setup Go"
9398
uses: actions/setup-go@v4
9499
with:
95100
go-version: "1.21.3"
96101
cache-dependency-path: "${{env.UPDATER_DIR}}/go.sum"
97-
102+
98103
- uses: actions/checkout@v3
99-
104+
100105
- name: "Create output path"
101106
working-directory: "${{env.UPDATER_DIR}}"
102-
run: mkdir ./output
103-
104-
- name: "Build (64 bit)"
107+
run: mkdir -p ./output
108+
109+
- name: "Build (64 bit Intel)"
105110
working-directory: "${{env.UPDATER_DIR}}"
106111
env:
107112
CGO_ENABLED: 1
108113
GOARCH: amd64
109114
GOOS: darwin
110115
run: |
111-
go build -o ../output/updaters/updater-macos-64
112-
113-
- name: "Build (apple 64 bit)"
116+
go build -o output/updater-macos-64
117+
118+
- name: "Build (64 bit ARM/M1)"
114119
working-directory: "${{env.UPDATER_DIR}}"
115120
env:
116121
CGO_ENABLED: 1
117122
GOARCH: arm64
118123
GOOS: darwin
119124
run: |
120-
go build -o ../output/updaters/updater-macos-m1-64
121-
125+
go build -o output/updater-macos-m1-64
126+
122127
- name: "Upload build"
123128
uses: actions/upload-artifact@v4
124129
with:
125130
name: updater-macos
126-
path: "${{env.UPDATER_DIR}}/output/updaters/*"
131+
path: "${{env.UPDATER_DIR}}/output/*"
127132
retention-days: 3
128133
compression-level: 9

0 commit comments

Comments
 (0)