Use alpine shell to load x86_64 and arm64 arch for RandomY lib (#30) #150
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: go-randomy build | |
on: [push] | |
jobs: | |
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: Test | |
shell: alpine.sh --root {0} | |
run: go test -v | |
build-windows: | |
runs-on: windows-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup | |
uses: actions/setup-go@v4 | |
with: | |
go-version: 1.23 | |
- name: Test | |
run: go test -v | |
build-darwin: | |
strategy: | |
matrix: | |
config: | |
- {os: macos-latest, arch: arm64} | |
- {os: macos-13, arch: amd64} | |
runs-on: ${{ matrix.config.os }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup | |
uses: actions/setup-go@v4 | |
with: | |
go-version: 1.23 | |
- name: Test | |
run: | | |
export GOARCH=${{ matrix.config.arch }} | |
export GOOS=darwin | |
go test -v | |
release: | |
needs: [build-alpine, build-windows, build-darwin] | |
runs-on: ubuntu-latest | |
if: github.ref == 'refs/heads/master' | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Bump version | |
id: version_bump | |
uses: anothrNick/github-tag-action@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
DEFAULT_BUMP: "patch" | |
RELEASE_BRANCHES: "master" | |
WITH_V: true | |
- name: Release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
with: | |
tag_name: ${{steps.version_bump.outputs.tag}} | |
release_name: go-randomy ${{steps.version_bump.outputs.tag}} | |
draft: false | |
prerelease: false |