From ecd9bd8eff441226646951431a5692c4a73f7d26 Mon Sep 17 00:00:00 2001 From: Sasha Zezulinsky Date: Mon, 21 Oct 2024 02:11:46 +0200 Subject: [PATCH] use the latest randomy * added darwin-arm64, linux-riscv64 and linux-aarch64 architecture --- .github/workflows/build.yml | 82 +++++++++++++++++++++++++++++-------- 1 file changed, 64 insertions(+), 18 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b10c46f22..2e8ad6ea9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,25 +1,16 @@ name: go-core build on: push jobs: - build: - strategy: - matrix: - platform: [ - {os: ubuntu-latest, path: linux-x86_64}, - {os: windows-latest, path: windows-x86_64}, - {os: raspbian-private, path: linux-arm64}, - {os: macos-latest, path: darwin-x86_64}, - ] - runs-on: ${{ matrix.platform.os }} + build-windows: + runs-on: windows-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup Go - uses: actions/setup-go@v2 + uses: actions/setup-go@v4 with: - go-version: 1.21.x + go-version: 1.23 - name: Setup MSYS - if: ${{ matrix.platform.os == 'windows-latest' }} uses: msys2/setup-msys2@v2 with: msystem: mingw64 @@ -39,7 +30,7 @@ jobs: run: | make gocore make test - - name: Build + - name: Build & Test if: ${{ matrix.platform.os != 'windows-latest' }} run: | make gocore @@ -50,9 +41,62 @@ jobs: with: name: gocore-${{ matrix.platform.path }} path: ./build/bin/gocore* + build-mac: + matrix: + strategy: + config: + - {os: macos-13, path: darwin-x86_64}, + - {os: macos-latest, path: darwin-arm64}, + runs-on: ${{ matrix.config.os }} + - name: Checkout + uses: actions/checkout@v4 + - name: Setup Go + uses: actions/setup-go@v4 + with: + go-version: 1.23 + - name: Build & Test + run: | + make gocore + make test + - name: Upload Gocore + if: startsWith(github.ref, 'refs/tags/v') + uses: actions/upload-artifact@v2 + with: + 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} + - {arch: riscv64, branch: edge} + needs: build + 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: Build & Test + run: | + make gocore + make test + - name: Upload Gocore + if: startsWith(github.ref, 'refs/tags/v') + uses: actions/upload-artifact@v2 + with: + name: gocore-linux-${{ matrix.config.arch }} + path: ./build/bin/gocore* release: if: startsWith(github.ref, 'refs/tags/v') - needs: build + needs: [build-windows, build-mac, build-alpine] runs-on: ubuntu-latest outputs: upload_url: ${{ steps.create_release.outputs.upload_url }} @@ -80,12 +124,14 @@ jobs: platform: [ {path: linux-x86_64, file_ext: ""}, {path: windows-x86_64, file_ext: ".exe"}, - {path: linux-arm64, file_ext: ""}, + {path: linux-aarch64, file_ext: ""}, + {path: linux-riscv64, file_ext: ""}, {path: darwin-x86_64, file_ext: ""}, + {path: darwin-arm64, file_ext: ""}, ] steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Artifact Gocore uses: actions/download-artifact@v2 with: