Skip to content

Test release

Test release #7

Workflow file for this run

name: Test release
on:
push:
tags:
- "*"
workflow_dispatch:
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- os: linux
arch: amd64
- os: linux
arch: arm64
- os: darwin
arch: amd64
- os: darwin
arch: arm64
- os: windows
arch: amd64
- os: windows
arch: arm64
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Go
uses: actions/setup-go@v6
with:
go-version: "1.25"
- name: Build
run: |
mkdir -p dist
EXT=""
if [ "${{ matrix.os }}" = "windows" ]; then EXT=".exe"; fi
if [ "${{ github.ref_type }}" = "tag" ]; then
VERSION="${{ github.ref_name }}"
else
VERSION="0.0.0"
fi
COMMIT=${{ github.sha }}
DATE=$(date -u +"%Y-%m-%d at %H:%M:%S")
DATE=${DATE// /\\}
GOOS=${{ matrix.os }} GOARCH=${{ matrix.arch }} \
go build \
-ldflags "\
-X sklair/constants.Version=$VERSION \
-X sklair/constants.Commit=$COMMIT \
-X sklair/constants.BuildDate=$DATE \
" \
-o dist/sklair-${{ matrix.os }}-${{ matrix.arch }}$EXT
- name: Upload artefacts
uses: actions/upload-artifact@v6
with:
name: sklair-${{ matrix.os }}-${{ matrix.arch }}
path: dist/*