build-alpine, build-darwin, build-windows #143
Workflow file for this run
This file contains 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} | |
- {arch: riscv64, branch: edge} | |
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 | |
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.21 | |
- name: Test | |
run: go test -v | |
build-darwin: | |
runs-on: macos-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup | |
uses: actions/setup-go@v4 | |
with: | |
go-version: 1.21 | |
- name: Test arm64 | |
run: | | |
export GOARCH=arm64 | |
export GOOS=darwin | |
go test -v | |
- name: Test amd64 | |
run: | | |
export GOARCH=amd64 | |
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 |