Skip to content

Commit

Permalink
added support for Apple M1 Silicon (darwin/arm64)
Browse files Browse the repository at this point in the history
  • Loading branch information
dh1tw committed Apr 17, 2021
1 parent b14644b commit 2920cf8
Showing 1 changed file with 21 additions and 8 deletions.
29 changes: 21 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 2920cf8

Please sign in to comment.