Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

modified to use the musl for a static build #9

Merged
merged 1 commit into from
Dec 28, 2024
Merged
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
22 changes: 13 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,10 @@ name: Release Build

on:
push:
# Trigger on version tags
tags:
- 'v*.*.*'
# Allow manual trigger
workflow_dispatch:

# Add permissions block
permissions:
contents: write
packages: write
Expand Down Expand Up @@ -59,22 +56,28 @@ jobs:
pciutils \
ethtool \
dmidecode \
ipmitool
ipmitool \
musl-tools # <-- Add musl-tools so we can build musl binaries

- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: x86_64-unknown-linux-gnu
override: true
# Add the musl target
target: x86_64-unknown-linux-musl

- name: Build Release Binary
- name: Build Release Binary (musl)
run: |
cargo build --release --target x86_64-unknown-linux-gnu
cargo build --release --target x86_64-unknown-linux-musl
mkdir -p build/release
cp target/x86_64-unknown-linux-gnu/release/hardware_report build/release/hardware_report-linux-x86_64
strip build/release/hardware_report-linux-x86_64

# Rename the musl-based binary
cp target/x86_64-unknown-linux-musl/release/hardware_report build/release/hardware_report-linux-x86_64

# Optional: 'strip' the binary to reduce size
strip build/release/hardware_report-linux-x86_64

- name: Create tarball
run: |
cd build/release
Expand All @@ -100,3 +103,4 @@ jobs:
asset_path: build/release/hardware_report-linux-x86_64-${{ needs.create-release.outputs.version }}.tar.gz.sha256
asset_name: hardware_report-linux-x86_64-${{ needs.create-release.outputs.version }}.tar.gz.sha256
asset_content_type: text/plain

Loading