Skip to content

ci: add GH Actions, releases, coverage badges #1

ci: add GH Actions, releases, coverage badges

ci: add GH Actions, releases, coverage badges #1

Workflow file for this run

name: Release
on:
push:
tags:
- "v*"
jobs:
build:
name: Build binaries
runs-on: ubuntu-latest
strategy:
matrix:
goos: [linux, windows, darwin]
goarch: [amd64, arm64]
fail-fast: false
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true
- name: Build gamifykit-server
run: |
mkdir -p dist
OUT="dist/gamifykit-server-${GOOS}-${GOARCH}"
if [ "${GOOS}" = "windows" ]; then OUT="${OUT}.exe"; fi
go build -o "${OUT}" ./cmd/gamifykit-server
- name: Build demo-server
run: |
mkdir -p dist
OUT="dist/demo-server-${GOOS}-${GOARCH}"
if [ "${GOOS}" = "windows" ]; then OUT="${OUT}.exe"; fi
go build -o "${OUT}" ./cmd/demo-server
- name: Generate checksums
run: |
cd dist
sha256sum * > checksums-${GOOS}-${GOARCH}.txt
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: artifacts-${{ matrix.goos }}-${{ matrix.goarch }}
path: dist/*
release:
name: Publish Release
needs: build
runs-on: ubuntu-latest
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: dist
- name: Create release
uses: softprops/action-gh-release@v2
with:
files: |
dist/**/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}