diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6c5ec12..ef3dd96 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -86,11 +86,25 @@ jobs: runs-on: ubuntu-22.04 needs: - test-linux + strategy: + matrix: + target: [ amd64, arm64 ] + include: + - target: amd64 + CGO_ENABLED: 0 + GOARCH: amd64 + - target: arm64 + CGO_ENABLED: 1 + GOARCH: arm64 + CC: ${{ github.workspace }}/gcc-linaro-4.8-2015.06-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc + toolchain_source: https://releases.linaro.org/archive/15.06/components/toolchain/binaries/4.8/aarch64-linux-gnu/gcc-linaro-4.8-2015.06-x86_64_aarch64-linux-gnu.tar.xz + toolchain_extract: tar -xf gcc-linaro-4.8-2015.06-x86_64_aarch64-linux-gnu.tar.xz env: CGO_ENABLED: 1 GOOS: linux GOARCH: arm64 CC: ${{ github.workspace }}/gcc-linaro-4.8-2015.06-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc + name: build-linux-${{ matrix.target }} steps: - uses: actions/checkout@v4 - uses: actions/download-artifact@v4 @@ -102,8 +116,10 @@ jobs: name: grpc path: pkg/a2l - run: | - wget https://releases.linaro.org/archive/15.06/components/toolchain/binaries/4.8/aarch64-linux-gnu/gcc-linaro-4.8-2015.06-x86_64_aarch64-linux-gnu.tar.xz - tar -xf gcc-linaro-4.8-2015.06-x86_64_aarch64-linux-gnu.tar.xz + wget ${{ matrix.toolchain_source }} + ${{ matrix.toolchain_extract }} + if: ${{ matrix.CGO_ENABLED == 1}} + - run: | go get github.com/antlr4-go/antlr/v4 go build --buildmode=c-shared -o a2l_grpc_$(go env GOOS)_$(go env GOARCH).so ./cmd/a2l/a2l.go - uses: actions/upload-artifact@v4