Skip to content

Commit

Permalink
Enable support for ARM64 chips.
Browse files Browse the repository at this point in the history
  • Loading branch information
Randy Coburn committed Mar 30, 2023
1 parent 5dc5352 commit 6ea6467
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 46 deletions.
87 changes: 44 additions & 43 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,51 +5,52 @@ jobs:
if: startsWith(github.ref, 'refs/heads/main')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: '^1.13.1'
- name: go test
run: go test -v ./...
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: "^1.19.1"
- name: go test
run: go test -v ./...
test_build_release:
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: '^1.13.1'
- name: Get the version
id: get_tag
run: echo ::set-output name=SOURCE_TAG::${GITHUB_REF#refs/tags/}
- name: go test
run: go test -v ./...
- name: build
shell: bash
run: |
# Make an artifacts directory
mkdir -p artifacts
# run the build for each supported OS
for os in "linux" "darwin" "windows"; do
echo "Building for $os..."
GOOS=$os CGO_ENABLED=0 go build -a -ldflags="-X main.version=${{ steps.get_tag.outputs.SOURCE_TAG }}" -o ./artifacts/launch_${os} .
# If its windows we need to rename it to have .exe at the end.
if [ $os == "windows" ]; then
mv ./artifacts/launch_$os ./artifacts/launch_$os.exe
fi
done
# Make an Arm bin for linux also
for arch in arm64 arm; do
echo "Building for linux on $arch..."
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} .
done
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: "^1.19.1"
- name: Get the version
id: get_tag
run: echo ::set-output name=SOURCE_TAG::${GITHUB_REF#refs/tags/}
- name: go test
run: go test -v ./...
- name: build
shell: bash
run: |
# Make an artifacts directory
mkdir -p artifacts
- name: Release
uses: softprops/action-gh-release@v1
with:
files: artifacts/*
body_path: .github/workflows/release_body.md
env:
GITHUB_TOKEN: ${{ github.token }}
# Run the build for each supported OS using x86_64.
# Building for windows.
echo "Building for Windows on amd64..."
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 .
# Make an ARM and ARM64 bin for linux and Mac.
for os in "linux" "darwin"; do
for arch in "amd64" "arm64" "arm"; do
echo "Building for $os on $arch..."
if [ "$os" = "darwin" ] && [ "$arch" = "arm" ]; then
echo "Skipping $os on $arch..."
continue
fi
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} .
done
done
- name: Release
uses: softprops/action-gh-release@v1
with:
files: artifacts/*
body_path: .github/workflows/release_body.md
env:
GITHUB_TOKEN: ${{ github.token }}
5 changes: 2 additions & 3 deletions .github/workflows/release_body.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# Bug fix and Github work flows
# Adding in more supported CPU architectures

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

0 comments on commit 6ea6467

Please sign in to comment.