Skip to content

amend workflow to build static binary and create release #6

amend workflow to build static binary and create release

amend workflow to build static binary and create release #6

Workflow file for this run

name: C Program Build
on:
push:
pull_request:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Build static binary in alpine container
uses: addnab/docker-run-action@v3
with:
image: alpine:latest
options: --rm -v ${{ github.workspace }}:/work --workdir /work
run: |
apk add --no-cache build-base
CFLAGS=-static LDFLAGS=-static make all
- name: verify binary is statically linked
run: ldd sherlock || echo "Binary is statically linked"
- name: add tarfile
run: |
fakeroot tar cf sherlock.tgz --gzip sherlock
- name: Upload compiled sherlock
uses: actions/upload-artifact@v4
with:
name: sherlock
path: sherlock
- name: Release (if tagged)
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
sherlock.tgz
draft: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}