Skip to content

Commit

Permalink
build x86_64 on ubuntu latest and arm64 on RPi
Browse files Browse the repository at this point in the history
  • Loading branch information
SashaZezulinsky committed Oct 24, 2024
1 parent 33d53ab commit 861bb53
Showing 1 changed file with 8 additions and 36 deletions.
44 changes: 8 additions & 36 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,15 @@ jobs:
name: gocore-windows-x86_64
path: ./build/bin/gocore*

build-mac:
build:
runs-on: ${{ matrix.config.os }}
strategy:
matrix:
config:
- {os: macos-13, path: darwin-x86_64}
- {os: macos-latest, path: darwin-arm64}
- {platform: macos-14, os: darwin, arch: amd64, path: darwin-x86_64}
- {platform: macos-latest, os: dawin, arch: arm64, path: darwin-arm64}
- {platform: ubuntu-latest, os: linux, arch: amd64, path: linux-x86_64}
- {platform: raspbian-private, os: linux, arch: arm64, path: linux-arm64}
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -51,6 +53,9 @@ jobs:
go-version: 1.23
- name: Build & Test
run: |
uname -m
export GOOS=${{ matrix.config.os }}
export GOARCH=${{ matrix.config.arch }}
make gocore
make test
- name: Upload Gocore
Expand All @@ -60,39 +65,6 @@ jobs:
name: gocore-${{ matrix.config.path }}
path: ./build/bin/gocore*

build-alpine:
strategy:
matrix:
config:
- {arch: x86_64, branch: latest-stable}
- {arch: aarch64, branch: latest-stable}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Alpine Linux
uses: jirutka/setup-alpine@v1
with:
arch: ${{ matrix.config.arch }}
branch: ${{ matrix.config.branch }}
- name: Install deps
shell: alpine.sh --root {0}
run: apk add git cmake gcc g++ make go
- name: Safelist
shell: alpine.sh --root {0}
run: git config --global --add safe.directory ${{ github.workspace }}
- name: Build & Test
shell: alpine.sh --root {0}
run: |
make gocore
make test
- name: Upload Gocore
if: startsWith(github.ref, 'refs/tags/v')
uses: actions/upload-artifact@v4
with:
name: gocore-linux-${{ matrix.config.arch }}
path: ./build/bin/gocore*

release:
if: startsWith(github.ref, 'refs/tags/v')
needs: [build-windows, build-mac, build-alpine]
Expand Down

0 comments on commit 861bb53

Please sign in to comment.