Skip to content

Update build binaries workflow #4

Update build binaries workflow

Update build binaries workflow #4

Workflow file for this run

name: Build Binaries
on:
push:
tags:
- 'v*'
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, macOS-latest ]
architecture: [ arm64, amd64 ]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Get latest tag
id: tag
run: echo "TAG=$(git describe --tags)" >> $GITHUB_ENV
- name: Install dependencies (Ubuntu)
if: runner.os == 'Linux'
run: sudo apt-get update -qq && sudo apt-get install -y upx-ucl build-essential cargo git golang
- name: Install dependencies (macOS)
if: runner.os == 'macOS'
run: brew install upx cargo-c
- name: Set up Go
uses: actions/setup-go@v4.1.0
with:
go-version-file: go.mod
- name: Build binary
run: |
GOARCH=${{ matrix.architecture }} make build
mv build/qasectl qasectl-${{ env.TAG }}-${{ runner.os }}-${{ matrix.architecture }}
- name: Generate Checksum
id: checksum
run: |
if [[ "${{ runner.os }}" == "macOS" ]]; then
shasum -a 256 qasectl-${{ env.TAG }}-${{ runner.os }}-${{ matrix.architecture }} > qasectl-${{ env.TAG }}-${{ runner.os }}-${{ matrix.architecture }}.sha256
else
sha256sum qasectl-${{ env.TAG }}-${{ runner.os }}-${{ matrix.architecture }} > qasectl-${{ env.TAG }}-${{ runner.os }}-${{ matrix.architecture }}.sha256
fi
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: qasectl-${{ env.TAG }}-${{ runner.os }}-${{ matrix.architecture }}
path: |
qasectl-${{ env.TAG }}-${{ runner.os }}-${{ matrix.architecture }}
qasectl-${{ env.TAG }}-${{ runner.os }}-${{ matrix.architecture }}.sha256