Skip to content

Update build paths to non-workspace #48

Update build paths to non-workspace

Update build paths to non-workspace #48

Workflow file for this run

name: Build Client Binaries
on:
push:
branches: ["feat/ci-client-builds"]
env:
CARGO_TERM_COLOR: always
PKG_CONFIG_ALLOW_CROSS: 1
RUSTFLAGS: "-C target-feature=-crt-static"
jobs:
build:
name: Build - ${{ matrix.platform.target }}
runs-on: ${{matrix.platform.os}}
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
platform:
- build: linux
os: ubuntu-latest
rust: stable
target: x86_64-unknown-linux-gnu
- build: linux
os: ubuntu-latest
rust: stable
target: aarch64-unknown-linux-gnu
- build: linux
os: ubuntu-latest
rust: stable
target: armv7-unknown-linux-gnueabihf
- build: macos
os: macos-latest
rust: stable
target: x86_64-apple-darwin
- build: macos-m1
os: macos-latest
rust: stable
target: aarch64-apple-darwin
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 1
- name: Cache
uses: actions/cache@v3
with:
path: |
truncate_client/.cargo/registry
truncate_client/.cargo/git
truncate_client/.rustup
truncate_client/target
key: ${{ runner.os }}-${{ matrix.platform.rust }}
- name: Install Linux Tooling
if: matrix.platform.os == 'ubuntu-latest'
run: |
sudo apt update -y
sudo apt install -y pkg-config libudev-dev
- name: Build binary
uses: houseabsolute/actions-rust-cross@v0
with:
command: build
target: ${{ matrix.platform.target }}
args: "--release"
working-directory: ./truncate_client
- name: Create Standard Release
run: |
EXEC_NAME="truncate_client"
ASSET_PATH="$EXEC_NAME-v$GIT_VERSION-${{ matrix.platform.target }}.tar.gz"
CHECKSUM_PATH="$ASSET_PATH.sha256"
if [ "$RUNNER_OS" == "Windows" ]; then
EXEC_NAME="truncate_client.exe"
fi
tar czf $ASSET_PATH -C truncate_client/target/${{ matrix.platform.target }}/release $EXEC_NAME
if command -v gtar &> /dev/null; then
echo "Using gtar"
gtar czf $ASSET_PATH -C truncate_client/target/${{ matrix.platform.target }}/release $EXEC_NAME
else
echo "Using system tar"
tar czf $ASSET_PATH -C truncate_client/target/${{ matrix.platform.target }}/release $EXEC_NAME
fi
case $RUNNER_OS in
Windows)
sha256sum $ASSET_PATH > $CHECKSUM_PATH
;;
Linux)
sha256sum $ASSET_PATH > $CHECKSUM_PATH
;;
macOS)
shasum -a 256 $ASSET_PATH > $CHECKSUM_PATH
;;
esac
echo "ASSET_PATH=$ASSET_PATH" >> $GITHUB_ENV
echo "CHECKSUM_PATH=$CHECKSUM_PATH" >> $GITHUB_ENV
- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: release
path: |
${{ env.ASSET_PATH }}
${{ env.CHECKSUM_PATH }}
- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: release-checksums
path: |
${{ env.CHECKSUM_PATH }}