Skip to content

Build

Build #6

Workflow file for this run

name: Build
on: workflow_dispatch
jobs:
build:
strategy:
fail-fast: false
matrix:
# platform: [linux/amd64, linux/arm64]
platform: [linux/amd64]
include:
- platform: linux/amd64
target: x86_64-unknown-linux-musl
runner: ubuntu-latest
# - platform: linux/arm64
# target: aarch64-unknown-linux-musl
# runner: ubuntu-latest
runs-on: ${{ matrix.runner }}
steps:
- uses: actions/checkout@v4
- name: Install asciidoctor
run: |
sudo apt update
sudo apt -y install asciidoctor
- name: Build Linux
run: |
docker run --platform ${{ matrix.platform }} --rm -t \
-v $HOME/.cargo/registry/:/root/.cargo/registry \
-v "$(pwd)":/volume \
clux/muslrust:stable \
env CFLAGS=-Os cargo build --release --target ${{ matrix.target }}
- name: Build man pages
run: |
asciidoctor -b manpage doc/fcd.1.adoc
asciidoctor -b manpage doc/fcd-view.1.adoc
- name: Package
run: |
mkdir fcd
cp fcd.{sh,fish} fcd/
cp doc/fcd{,-view}.1 fcd/
cp target/${{ matrix.target }}/release/fcd fcd/
tar cvzf fcd-${{ matrix.target }}.tar.gz fcd/
- name: Upload
uses: actions/upload-artifact@v4
with:
name: fcd-${{ matrix.target }}
path: fcd-${{ matrix.target }}.tar.gz
if-no-files-found: error