Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
125 changes: 125 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
name: Release binaries

concurrency:
group: release
cancel-in-progress: true

on:
push:
tags:
- "**"
pull_request:
workflow_dispatch:

jobs:
build-linux:
name: Build Linux
runs-on: ubuntu-24.04

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JFYI: not sure whether this applies in case of bbk CLI, though building on very latest Ubuntu runner isn't always beneficial. If the tool depends on very latest glibc, it may fail on older, though still supported versions of Ubuntu. A random illustrative example of what I mean: hougesen/mdsf#1322

strategy:
matrix:
arch: [amd64, arm64, armhf, i386, mips]
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Build
run: |
cd src/cli
make -j
mv cli bbk-linux-${{ matrix.arch }}
- name: Upload
uses: actions/upload-artifact@v4
with:
name: bbk-linux-${{ matrix.arch }}
path: src/cli/bbk-linux-${{ matrix.arch }}

build-macos:
name: Build macOS
runs-on: macos-13
steps:
- uses: actions/checkout@v4
- run: |
cd src/cli
make -j
mv cli bbk-macos-amd64
- uses: actions/upload-artifact@v4
with:
name: bbk-macos-amd64
path: src/cli/bbk-macos-amd64

build-windows:
name: Build Windows
runs-on: windows-2025
steps:
- uses: actions/checkout@v4

- name: Add msbuild
uses: microsoft/setup-msbuild@v2

- name: Build
run: |
msbuild src/wincli/wincli.sln /p:Configuration=Release /m
mv src/wincli/x64/Release/wincli.exe bbk-windows-amd64.exe
- uses: actions/upload-artifact@v4
with:
name: bbk-windows-amd64
path: bbk-windows-amd64.exe

build-freebsd:
name: Build FreeBSD
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: vmactions/freebsd-vm@v1
with:
run: |
pkg install -y gmake gcc
cd src/cli && gmake && mv cli bbk-freebsd-amd64
- uses: actions/upload-artifact@v4
with:
name: bbk-freebsd-amd64
path: src/cli/bbk-freebsd-amd64

build-openbsd:
name: Build OpenBSD
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: vmactions/openbsd-vm@v1
with:
run: |
pkg_add gmake gcc
cd src/cli && gmake && mv cli bbk-openbsd-amd64
- uses: actions/upload-artifact@v4
with:
name: bbk-openbsd-amd64
path: src/cli/bbk-openbsd-amd64

release:
name: Create GitHub Release
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
needs:
- build-linux
- build-macos
- build-windows
- build-freebsd
- build-openbsd
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4

- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: artifacts/

- name: Generate release notes
run: git log -1 --pretty='%s' > RELEASE.md

- name: Publish release
uses: softprops/action-gh-release@v2
with:
files: artifacts/**/*
body_path: RELEASE.md