Skip to content

Commit 6ea6467

Browse files
author
Randy Coburn
committed
Enable support for ARM64 chips.
1 parent 5dc5352 commit 6ea6467

File tree

2 files changed

+46
-46
lines changed

2 files changed

+46
-46
lines changed

.github/workflows/build.yml

+44-43
Original file line numberDiff line numberDiff line change
@@ -5,51 +5,52 @@ jobs:
55
if: startsWith(github.ref, 'refs/heads/main')
66
runs-on: ubuntu-latest
77
steps:
8-
- uses: actions/checkout@v2
9-
- uses: actions/setup-go@v2
10-
with:
11-
go-version: '^1.13.1'
12-
- name: go test
13-
run: go test -v ./...
8+
- uses: actions/checkout@v3
9+
- uses: actions/setup-go@v4
10+
with:
11+
go-version: "^1.19.1"
12+
- name: go test
13+
run: go test -v ./...
1414
test_build_release:
1515
if: startsWith(github.ref, 'refs/tags/')
1616
runs-on: ubuntu-latest
1717
steps:
18-
- uses: actions/checkout@v2
19-
- uses: actions/setup-go@v2
20-
with:
21-
go-version: '^1.13.1'
22-
- name: Get the version
23-
id: get_tag
24-
run: echo ::set-output name=SOURCE_TAG::${GITHUB_REF#refs/tags/}
25-
- name: go test
26-
run: go test -v ./...
27-
- name: build
28-
shell: bash
29-
run: |
30-
# Make an artifacts directory
31-
mkdir -p artifacts
32-
33-
# run the build for each supported OS
34-
for os in "linux" "darwin" "windows"; do
35-
echo "Building for $os..."
36-
GOOS=$os CGO_ENABLED=0 go build -a -ldflags="-X main.version=${{ steps.get_tag.outputs.SOURCE_TAG }}" -o ./artifacts/launch_${os} .
37-
38-
# If its windows we need to rename it to have .exe at the end.
39-
if [ $os == "windows" ]; then
40-
mv ./artifacts/launch_$os ./artifacts/launch_$os.exe
41-
fi
42-
done
43-
# Make an Arm bin for linux also
44-
for arch in arm64 arm; do
45-
echo "Building for linux on $arch..."
46-
GOOS=linux GOARCH=$arch CGO_ENABLED=0 go build -a -ldflags="-X main.version=${{ steps.get_tag.outputs.SOURCE_TAG }}" -o ./artifacts/launch_linux_${arch} .
47-
done
18+
- uses: actions/checkout@v3
19+
- uses: actions/setup-go@v4
20+
with:
21+
go-version: "^1.19.1"
22+
- name: Get the version
23+
id: get_tag
24+
run: echo ::set-output name=SOURCE_TAG::${GITHUB_REF#refs/tags/}
25+
- name: go test
26+
run: go test -v ./...
27+
- name: build
28+
shell: bash
29+
run: |
30+
# Make an artifacts directory
31+
mkdir -p artifacts
4832
49-
- name: Release
50-
uses: softprops/action-gh-release@v1
51-
with:
52-
files: artifacts/*
53-
body_path: .github/workflows/release_body.md
54-
env:
55-
GITHUB_TOKEN: ${{ github.token }}
33+
# Run the build for each supported OS using x86_64.
34+
# Building for windows.
35+
echo "Building for Windows on amd64..."
36+
GOOS=$os GOARCH=amd64 CGO_ENABLED=0 go build -a -ldflags="-X main.version=${{ steps.get_tag.outputs.SOURCE_TAG }}" -o ./artifacts/launch_windows.exe .
37+
38+
# Make an ARM and ARM64 bin for linux and Mac.
39+
for os in "linux" "darwin"; do
40+
for arch in "amd64" "arm64" "arm"; do
41+
echo "Building for $os on $arch..."
42+
if [ "$os" = "darwin" ] && [ "$arch" = "arm" ]; then
43+
echo "Skipping $os on $arch..."
44+
continue
45+
fi
46+
GOOS=$os GOARCH=$arch CGO_ENABLED=0 go build -a -ldflags="-X main.version=${{ steps.get_tag.outputs.SOURCE_TAG }}" -o ./artifacts/launch_${os}_${arch} .
47+
done
48+
done
49+
50+
- name: Release
51+
uses: softprops/action-gh-release@v1
52+
with:
53+
files: artifacts/*
54+
body_path: .github/workflows/release_body.md
55+
env:
56+
GITHUB_TOKEN: ${{ github.token }}

.github/workflows/release_body.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# Bug fix and Github work flows
1+
# Adding in more supported CPU architectures
22

3-
Fixed a bug where processes set to have a start delay did not delay.
4-
Adding in Github work flow.
3+
This can now be used on arm64 chips. This enables use on apple silicon and other arm64 chips.

0 commit comments

Comments
 (0)