Skip to content

Commit

Permalink
Add release CI, tweak README (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
mlange-42 authored Jun 10, 2024
1 parent 4dfe9dc commit 9208a62
Show file tree
Hide file tree
Showing 4 changed files with 275 additions and 12 deletions.
130 changes: 130 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
name: Release

on:
release:
types: [ created ]

jobs:
build-linux:
name: Linux build
runs-on: ubuntu-latest
steps:
- name: Get tag
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
shell: bash
- uses: actions/checkout@v3
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: '1.22.x'
- name: Install dependencies
run: |
go get ./...
- name: Build
run: |
GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" ./cmd/bbn
GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" ./cmd/bbni
- name: Compress binaries
run: |
tar -czf bbn.tar.gz bbn bbni
shell: bash
- name: Upload binaries
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: bbn.tar.gz
asset_name: bbn-${{ env.RELEASE_VERSION }}-linux-amd64.tar.gz
tag: ${{ github.ref }}

build-windows:
name: Windows build
runs-on: ubuntu-latest
steps:
- name: Get tag
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
shell: bash
- uses: actions/checkout@v3
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: '1.22.x'
- name: Install dependencies
run: |
go get ./...
- name: Build
run: |
GOOS=windows GOARCH=amd64 go build -ldflags="-s -w" ./cmd/bbn
GOOS=windows GOARCH=amd64 go build -ldflags="-s -w" ./cmd/bbni
- name: Compress binaries
run: |
zip -r bbn.zip bbn.exe bbni.exe
shell: bash
- name: Upload binaries
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: bbn.zip
asset_name: bbn-${{ env.RELEASE_VERSION }}-windows-amd64.zip
tag: ${{ github.ref }}

build-macos-arm64:
name: MacOS arm64 build
runs-on: macos-latest
steps:
- name: Get tag
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
shell: bash
- uses: actions/checkout@v3
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: '1.22.x'
- name: Install dependencies
run: |
go get ./...
- name: Build
run: |
GOOS=darwin GOARCH=arm64 go build -ldflags="-s -w" ./cmd/bbn
GOOS=darwin GOARCH=arm64 go build -ldflags="-s -w" ./cmd/bbni
- name: Compress binaries
run: |
zip -r bbn.zip bbn bbni
shell: bash
- name: Upload binaries
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: bbn.zip
asset_name: bbn-${{ env.RELEASE_VERSION }}-macos-arm64.zip
tag: ${{ github.ref }}

build-macos-amd64:
name: MacOS amd64 build
runs-on: macos-latest
steps:
- name: Get tag
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
shell: bash
- uses: actions/checkout@v3
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: '1.22.x'
- name: Install dependencies
run: |
go get ./...
- name: Build
run: |
GOOS=darwin GOARCH=amd64 go build -ldflags="-s -w" ./cmd/bbn
GOOS=darwin GOARCH=amd64 go build -ldflags="-s -w" ./cmd/bbni
- name: Compress binaries
run: |
zip -r bbn.zip bbn bbni
shell: bash
- name: Upload binaries
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: bbn.zip
asset_name: bbn-${{ env.RELEASE_VERSION }}-macos-amd64.zip
tag: ${{ github.ref }}
126 changes: 126 additions & 0 deletions .github/workflows/test-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
name: Test Release

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build-linux:
name: Linux build
runs-on: ubuntu-latest
steps:
- name: Get tag
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
shell: bash
- uses: actions/checkout@v3
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: '1.22.x'
- name: Install dependencies
run: |
go get ./...
- name: Build
run: |
GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" ./cmd/bbn
GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" ./cmd/bbni
- name: Compress binaries
run: |
tar -czf bbn.tar.gz bbn bbni
shell: bash
- name: Archive artifacts
uses: actions/upload-artifact@v4
with:
name: bbn-linux-amd64.tar.gz
path: bbn.tar.gz

build-windows:
name: Windows build
runs-on: ubuntu-latest
steps:
- name: Get tag
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
shell: bash
- uses: actions/checkout@v3
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: '1.22.x'
- name: Install dependencies
run: |
go get ./...
- name: Build
run: |
GOOS=windows GOARCH=amd64 go build -ldflags="-s -w" ./cmd/bbn
GOOS=windows GOARCH=amd64 go build -ldflags="-s -w" ./cmd/bbni
- name: Compress binaries
run: |
zip -r bbn.zip bbn.exe bbni.exe
shell: bash
- name: Archive artifacts
uses: actions/upload-artifact@v4
with:
name: bbn-windows-amd64.zip
path: bbn.zip

build-macos-arm64:
name: MacOS arm64 build
runs-on: macos-latest
steps:
- name: Get tag
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
shell: bash
- uses: actions/checkout@v3
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: '1.22.x'
- name: Install dependencies
run: |
go get ./...
- name: Build
run: |
GOOS=darwin GOARCH=arm64 go build -ldflags="-s -w" ./cmd/bbn
GOOS=darwin GOARCH=arm64 go build -ldflags="-s -w" ./cmd/bbni
- name: Compress binaries
run: |
zip -r bbn.zip bbn bbni
shell: bash
- name: Archive artifacts
uses: actions/upload-artifact@v4
with:
name: bbn-macos-arm64.zip
path: bbn.zip

build-macos-amd64:
name: MacOS amd64 build
runs-on: macos-latest
steps:
- name: Get tag
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
shell: bash
- uses: actions/checkout@v3
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: '1.22.x'
- name: Install dependencies
run: |
go get ./...
- name: Build
run: |
GOOS=darwin GOARCH=amd64 go build -ldflags="-s -w" ./cmd/bbn
GOOS=darwin GOARCH=amd64 go build -ldflags="-s -w" ./cmd/bbni
- name: Compress binaries
run: |
zip -r bbn.zip bbn bbni
shell: bash
- name: Archive artifacts
uses: actions/upload-artifact@v4
with:
name: bbn-macos-amd64.zip
path: bbn.zip
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Changelog

## [[v0.1.0]](https://github.com/mlange-42/bbn/commits/v0.1.0/)

Initial release of BBN, the Bayesian Belief Network library and CLI/TUI tool for [Go](https://go.dev).
26 changes: 14 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,25 @@ Bayesian Belief Network library and CLI/TUI tool for [Go](https://go.dev).

![screenshot](https://github.com/mlange-42/bbn/assets/44003176/0844f5dd-0078-4ba3-8ef8-18441669900a)

## Installation

### Command line tools
## Features

As long as there are no precompiled binaries provided, [Go](https://go.dev) is required for installation.
* Minimal, fast API for usage as a library.
* Human-readable YAML format for networks.
* Train and query networks from the command line with `bbn`.
* Visualize, query and explore networks in the interactive TUI app `bbni`.

The interactive terminal app `bbni`:
## Installation

```
go install github.com/mlange-42/bbn/cmd/bbni@latest
```
### Command line tools

The command line tool `bbn`:
Pre-compiled binaries for Linux, Windows and MacOS are available in the
[Releases](https://github.com/mlange-42/bbn/releases).

```
go install github.com/mlange-42/bbn/cmd/bbn@latest
```
> Alternatively, install the latest development versions of `bbn` and `bbni` using [Go](https://go.dev):
> ```shell
> go install github.com/mlange-42/bbn/cmd/bbn@main
> go install github.com/mlange-42/bbn/cmd/bbni@main
> ```
### Library
Expand Down

0 comments on commit 9208a62

Please sign in to comment.