Skip to content

Commit 4a9b413

Browse files
committed
add tasks to build with fixed tags (💩) useful in test.yml
having no fixed tags was causing the agent to autoupdate itself the first time it gets connected with create
1 parent 0e658b3 commit 4a9b413

File tree

2 files changed

+25
-9
lines changed

2 files changed

+25
-9
lines changed

.github/workflows/test.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,12 @@ jobs:
5050
run: task test-unit
5151

5252
- name: Build the Agent for linux
53-
run: task build
53+
run: task test:build
5454
if: matrix.operating-system == 'ubuntu-18.04'
5555

5656
# build the agent without GUI support (no tray icon)
5757
- name: Build the Agent-cli
58-
run: task build-cli
58+
run: task test:build-cli
5959
if: matrix.operating-system == 'ubuntu-18.04'
6060

6161
# the manifest is required by windows GUI apps, otherwise the binary will crash with: "Unable to create main window: TTM_ADDTOOL failed" (for reference https://github.com/lxn/walk/issues/28)
@@ -72,14 +72,14 @@ jobs:
7272
GO386: 387 # support old instruction sets without MMX (used in the Pentium 4) (will be deprecated in GO > 1.15 https://golang.org/doc/go1.15)
7373
run: |
7474
rsrc -arch 386 -manifest manifest.xml
75-
task build-win
75+
task test:build-win
7676
rm *.syso
7777
if: matrix.operating-system == 'windows-2019'
7878

7979
- name: Build the Agent for win64
8080
run: |
8181
rsrc -arch amd64 -manifest manifest.xml
82-
task build-win
82+
task test:build-win
8383
rm *.syso
8484
if: matrix.operating-system == 'windows-2019'
8585

@@ -88,7 +88,7 @@ jobs:
8888
MACOSX_DEPLOYMENT_TARGET: 10.11 # minimum supported version for mac
8989
CGO_CFLAGS: -mmacosx-version-min=10.11
9090
CGO_LDFLAGS: -mmacosx-version-min=10.11
91-
run: task build
91+
run: task test:build
9292
if: matrix.operating-system == 'macos-10.15'
9393

9494
# config.ini is required by the executable when it's run

Taskfile.yml

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,22 @@ tasks:
1717
cmds:
1818
- go build -v -i -o {{.APP_NAME}}_{{.GOARCH}} {{.WIN_LDFLAGS}}
1919

20+
test:build:
21+
desc: Build the project for test.yml
22+
env:
23+
cmds:
24+
- go build -v -i -o {{.APP_NAME}} {{.TEST_LDFLAGS}}
25+
26+
test:build-cli:
27+
desc: Build the project without tray support for test.yml
28+
cmds:
29+
- go build -v -i -tags cli -o {{.APP_NAME}}_cli {{.TEST_LDFLAGS}}
30+
31+
test:build-win:
32+
desc: Build the project for win for test.yml
33+
cmds:
34+
- go build -v -i -o {{.APP_NAME}}_{{.GOARCH}} {{.TEST_WIN_LDFLAGS}}
35+
2036
test:
2137
desc: Run the full testsuite, `legacy` will be skipped
2238
cmds:
@@ -55,7 +71,6 @@ vars:
5571
WIN_FLAGS: -H=windowsgui
5672
COMMIT:
5773
sh: echo ${TRAVIS_COMMIT:-`git log -n 1 --format=%h`}
58-
TEST_COMMIT: "deadbeef"
5974
TAG:
6075
sh: echo `git describe --tags --abbrev=0`
6176
TEST_TAG: "0.0.0-dev"
@@ -68,10 +83,11 @@ vars:
6883
{{.WIN_FLAGS}}'
6984
TEST_LDFLAGS: >
7085
-ldflags '-X main.version={{.TEST_TAG}}
71-
-X main.git_revision={{.TEST_COMMIT}}'
72-
TEST_TEST_LDFLAGS: >
86+
-X main.git_revision={{.COMMIT}}'
87+
TEST_WIN_LDFLAGS: >
7388
-ldflags '-X main.version={{.TEST_TAG}}
74-
-X main.git_revision={{.TEST_COMMIT}}'
89+
-X main.git_revision={{.COMMIT}}
90+
{{.WIN_FLAGS}}'
7591
7692
GOFLAGS: "-timeout 10m -v -coverpkg=./... -covermode=atomic"
7793
# check-lint vars

0 commit comments

Comments
 (0)