Skip to content

Commit fa520b2

Browse files
committed
Added Win/ARM64 build
1 parent 36f8422 commit fa520b2

File tree

3 files changed

+49
-0
lines changed

3 files changed

+49
-0
lines changed

.github/workflows/publish-go-tester-task.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,9 @@ jobs:
8787
- task: Windows_64bit
8888
path: "*Windows_64bit.zip"
8989
artifact-name: Windows_X86-64
90+
- task: Windows_ARM64
91+
path: "*Windows_ARM64.zip"
92+
artifact-name: Windows_ARM64
9093
- task: Linux_32bit
9194
path: "*Linux_32bit.tar.gz"
9295
artifact-name: Linux_X86-32
@@ -119,6 +122,15 @@ jobs:
119122
repo-token: ${{ secrets.GITHUB_TOKEN }}
120123
version: 3.x
121124

125+
- name: Install Latest Docker and QEMU
126+
run: |
127+
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
128+
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
129+
sudo apt-get update
130+
sudo apt-get install docker-ce
131+
sudo apt-get install qemu-user-static
132+
docker --version
133+
122134
- name: Build
123135
run: |
124136
PACKAGE_NAME_PREFIX=${{ needs.package-name-prefix.outputs.prefix }}

.github/workflows/release-go-task.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ jobs:
2727
artifact-suffix: Windows_32bit
2828
- task: Windows_64bit
2929
artifact-suffix: Windows_64bit
30+
- task: Windows_ARM64
31+
artifact-suffix: Windows_ARM64
3032
- task: Linux_32bit
3133
artifact-suffix: Linux_32bit
3234
- task: Linux_64bit
@@ -64,6 +66,15 @@ jobs:
6466
repo-token: ${{ secrets.GITHUB_TOKEN }}
6567
version: 3.x
6668

69+
- name: Install Latest Docker and QEMU
70+
run: |
71+
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
72+
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
73+
sudo apt-get update
74+
sudo apt-get install docker-ce
75+
sudo apt-get install qemu-user-static
76+
docker --version
77+
6778
- name: Build
6879
run: task dist:${{ matrix.os.task }}
6980

DistTasks.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,32 @@ tasks:
7474
PACKAGE_PLATFORM: "Windows_64bit"
7575
PACKAGE_NAME: "{{.PROJECT_NAME}}_{{.VERSION}}_{{.PACKAGE_PLATFORM}}.zip"
7676

77+
Windows_ARM64:
78+
desc: Builds Windows ARM64 binaries
79+
dir: "{{.DIST_DIR}}"
80+
cmds:
81+
- |
82+
docker run \
83+
-v `pwd`/..:/home/build \
84+
-w /home/build \
85+
-e CGO_ENABLED=1 \
86+
{{.CONTAINER}}:{{.CONTAINER_TAG}} \
87+
--build-cmd "{{.BUILD_COMMAND}}" \
88+
-p "{{.BUILD_PLATFORM}}"
89+
90+
zip \
91+
{{.PACKAGE_NAME}} \
92+
{{.PLATFORM_DIR}}/{{.PROJECT_NAME}}.exe ../LICENSE.txt \
93+
-j
94+
95+
vars:
96+
PLATFORM_DIR: "{{.PROJECT_NAME}}_windows_arm64"
97+
BUILD_COMMAND: "go build -buildvcs=false -o {{.DIST_DIR}}/{{.PLATFORM_DIR}}/{{.PROJECT_NAME}}.exe {{.LDFLAGS}}"
98+
BUILD_PLATFORM: "windows/arm64"
99+
CONTAINER_TAG: "{{.GO_VERSION}}-windows-arm64-debian12"
100+
PACKAGE_PLATFORM: "Windows_ARM64"
101+
PACKAGE_NAME: "{{.PROJECT_NAME}}_{{.VERSION}}_{{.PACKAGE_PLATFORM}}.zip"
102+
77103
Linux_32bit:
78104
desc: Builds Linux 32 bit binaries
79105
dir: "{{.DIST_DIR}}"

0 commit comments

Comments
 (0)