Skip to content

Commit

Permalink
Build x86_64 on ubuntu-latest and arm64 on raspbian-private runners (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
SashaZezulinsky authored Oct 24, 2024
1 parent 33d53ab commit 0a8dfdf
Showing 1 changed file with 17 additions and 63 deletions.
80 changes: 17 additions & 63 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
name: go-core build
on: push
jobs:
build-windows:
runs-on: windows-latest
build:
runs-on: ${{ matrix.config.platform }}
strategy:
matrix:
config:
- {platform: windows-latest, os: windows, arch: amd64, path: windows-x86_64}
- {platform: macos-13, os: darwin, arch: amd64, path: darwin-x86_64}
- {platform: macos-latest, os: darwin, 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 @@ -11,6 +19,7 @@ jobs:
with:
go-version: 1.23
- name: Setup MSYS
if: ${{ matrix.config.platform == 'windows-latest' }}
uses: msys2/setup-msys2@v2
with:
msystem: mingw64
Expand All @@ -24,33 +33,12 @@ jobs:
libtool
mingw-w64-x86_64-toolchain
mingw-w64-x86_64-go
- name: Build Windows
run: |
make gocore
make test
- name: Upload Gocore
if: startsWith(github.ref, 'refs/tags/v')
uses: actions/upload-artifact@v4
with:
name: gocore-windows-x86_64
path: ./build/bin/gocore*

build-mac:
runs-on: ${{ matrix.config.os }}
strategy:
matrix:
config:
- {os: macos-13, path: darwin-x86_64}
- {os: macos-latest, path: darwin-arm64}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: 1.23
- name: Build & Test
shell: bash
run: |
uname -m
export GOOS=${{ matrix.config.os }}
export GOARCH=${{ matrix.config.arch }}
make gocore
make test
- name: Upload Gocore
Expand All @@ -60,42 +48,9 @@ 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]
needs: build
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
Expand Down Expand Up @@ -124,8 +79,7 @@ jobs:
platform: [
{path: linux-x86_64, file_ext: ""},
{path: windows-x86_64, file_ext: ".exe"},
{path: linux-aarch64, file_ext: ""},
{path: linux-riscv64, file_ext: ""},
{path: linux-arm64, file_ext: ""},
{path: darwin-x86_64, file_ext: ""},
{path: darwin-arm64, file_ext: ""},
]
Expand Down

0 comments on commit 0a8dfdf

Please sign in to comment.