Skip to content

Commit 03fd1a8

Browse files
committed
add win64 build in and refactor taskfile
Still to handle: TEST_TAG in test.yml and win binary name in release.yml
1 parent 33752ee commit 03fd1a8

File tree

2 files changed

+27
-13
lines changed

2 files changed

+27
-13
lines changed

.github/workflows/test.yml

+13-4
Original file line numberDiff line numberDiff line change
@@ -59,19 +59,28 @@ jobs:
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)
62-
# rsrc will produce *.syso files that should get automatically recognized by go build command and linked into an executable.
63-
- name: Embed manifest in win binary
62+
# rsrc will produce a *.syso file that should get automatically recognized by go build command and linked into an executable.
63+
- name: Download tool to embed manifest in win binary
6464
run: |
6565
go get github.com/akavel/rsrc
66-
rsrc -arch 386 -manifest manifest.xml
6766
if: matrix.operating-system == 'windows-2019'
6867

6968
# building the agent for win requires a different task because of an extra flag
7069
- name: Build the Agent for win32
7170
env:
7271
GOARCH: 386 # 32bit architecture (for support)
7372
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)
74-
run: task build-win32
73+
run: |
74+
rsrc -arch 386 -manifest manifest.xml
75+
task build-win
76+
rm *.syso
77+
if: matrix.operating-system == 'windows-2019'
78+
79+
- name: Build the Agent for win64
80+
run: |
81+
rsrc -arch amd64 -manifest manifest.xml
82+
task build-win
83+
rm *.syso
7584
if: matrix.operating-system == 'windows-2019'
7685

7786
- name: Build the Agent for macos

Taskfile.yml

+14-9
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@ tasks:
55
build:
66
desc: Build the project
77
cmds:
8-
- go build -v -i {{.LDFLAGS}}
8+
- go build -v -i -o {{.APP_NAME}} {{.LDFLAGS}}
99

1010
build-cli:
1111
desc: Build the project without tray support
1212
cmds:
1313
- go build -v -i -tags cli -o {{.APP_NAME}}_cli {{.LDFLAGS}}
1414

15-
build-win32:
16-
desc: Build the project for win 32 bit
15+
build-win:
16+
desc: Build the project for win
1717
cmds:
18-
- go build -v -i {{.WIN_LDFLAGS}}
18+
- go build -v -i -o {{.APP_NAME}}_{{.GOARCH}} {{.WIN_LDFLAGS}}
1919

2020
test:
2121
desc: Run the full testsuite, `legacy` will be skipped
@@ -50,25 +50,30 @@ vars:
5050
sh: echo `go list ./... | grep -v 'arduino-create-agent/gen/' | tr '\n' ' '`
5151
# build vars
5252
APP_NAME: arduino-create-agent
53+
GOARCH:
54+
sh: go env GOARCH
5355
WIN_FLAGS: -H=windowsgui
5456
COMMIT:
5557
sh: echo ${TRAVIS_COMMIT:-`git log -n 1 --format=%h`}
58+
TEST_COMMIT: "deadbeef"
5659
TAG:
5760
sh: echo `git describe --tags --abbrev=0`
61+
TEST_TAG: "0.0.0-dev"
5862
LDFLAGS: >
5963
-ldflags '-X main.version={{.TAG}}
6064
-X main.git_revision={{.COMMIT}}'
6165
WIN_LDFLAGS: >
6266
-ldflags '-X main.version={{.TAG}}
6367
-X main.git_revision={{.COMMIT}}
6468
{{.WIN_FLAGS}}'
65-
# test vars
66-
GOFLAGS: "-timeout 10m -v -coverpkg=./... -covermode=atomic"
67-
TEST_VERSIONSTRING: "0.0.0-alpha"
68-
TEST_COMMIT: "deadbeef"
6969
TEST_LDFLAGS: >
70-
-ldflags '-X main.version={{.TEST_VERSIONSTRING}}
70+
-ldflags '-X main.version={{.TEST_TAG}}
7171
-X main.git_revision={{.TEST_COMMIT}}'
72+
TEST_TEST_LDFLAGS: >
73+
-ldflags '-X main.version={{.TEST_TAG}}
74+
-X main.git_revision={{.TEST_COMMIT}}'
75+
76+
GOFLAGS: "-timeout 10m -v -coverpkg=./... -covermode=atomic"
7277
# check-lint vars
7378
GOLINTBIN:
7479
sh: go list -f {{"{{"}}".Target{{"}}"}}" golang.org/x/lint/golint

0 commit comments

Comments
 (0)