From 2920cf8adee154b9787fa2c15c9504942c6d4477 Mon Sep 17 00:00:00 2001 From: "Tobias Wellnitz, DH1TW" Date: Sat, 17 Apr 2021 17:09:16 +0200 Subject: [PATCH] added support for Apple M1 Silicon (darwin/arm64) --- .github/workflows/build.yml | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1a10dd2..9354329 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,7 +4,7 @@ on: [push, pull_request] jobs: build_linux: - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 strategy: matrix: version: ['linux-arm', 'linux-386', 'linux-amd64', 'windows-386', 'windows-amd64'] @@ -72,6 +72,16 @@ jobs: build_macos: runs-on: macos-latest + strategy: + matrix: + version: ['macos-amd64', 'macos-arm64'] + include: + - version: macos-amd64 + GOOS: darwin + GOARCH: amd64 + - version: macos-arm64 + GOOS: darwin + GOARCH: arm64 steps: - name: Set up Go 1.16 @@ -101,8 +111,8 @@ jobs: - name: Compile env: - GOOS: darwin - GOARCH: amd64 + GOOS: ${{ matrix.GOOS }} + GOARCH: ${{ matrix.GOARCH }} run: make dist - name: Prepare build artifact for stashing @@ -114,11 +124,11 @@ jobs: name: Stash the build artifact uses: actions/upload-artifact@v1 with: - name: remoteRotator-darwin-amd64-${{ github.sha }} + name: remoteRotator-${{ matrix.GOOS }}-${{ matrix.GOARCH }}-${{ github.sha }} path: ./release test_linux: - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 steps: - name: Set up Go 1.16 @@ -181,7 +191,7 @@ jobs: # A Github release is created whenever the git reference contains a tag, starting with 'v*' (e.g. v0.4.2) # And the previous build jobs have been successful create_release: - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 needs: [build_linux, build_macos, test_linux, test_macos] if: startsWith(github.ref, 'refs/tags/v') steps: @@ -211,11 +221,11 @@ jobs: # In this job we upload the release artifacts to the corresponding release upload: - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 needs: create_release # release must be created before this job can start strategy: matrix: - version: ['linux-arm', 'linux-386', 'linux-amd64', 'windows-386', 'windows-amd64', 'darwin-amd64'] + version: ['linux-arm', 'linux-386', 'linux-amd64', 'windows-386', 'windows-amd64', 'darwin-amd64', 'darwin-arm64'] include: # add the GO environment variables - version: linux-arm @@ -236,6 +246,9 @@ jobs: - version: darwin-amd64 GOOS: darwin GOARCH: amd64 + - version: darwin-arm64 + GOOS: darwin + GOARCH: arm64 steps: - # Since Github actions (currently) doesn't provide a slugged version of the git tag we have to