Skip to content

Build and Release CLI #9

Build and Release CLI

Build and Release CLI #9

name: Build and Release CLI
on:
workflow_dispatch:
push:
tags:
- cbers4asat-cli-v*
env:
CARGO_TERM_COLOR: always
jobs:
cli-linux-build:
name: Build LINUX binaries
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./cli
steps:
- uses: actions/checkout@v3
- name: Build linux binaries
run: cargo build --release
- name: Shipping generic linux binary
run: |
mkdir dist/
tar -czvf dist/cbers4asat-x86_64-unknown-linux-gnu.tar.gz --directory=target/release/ cbers4asat
- name: Shipping debian linux binary
run: |
mkdir -p package/deb/usr/bin
cp target/release/cbers4asat package/deb/usr/bin
cp -r package/deb /tmp/cbers4asat
dpkg-deb --build /tmp/cbers4asat
cp /tmp/cbers4asat.deb dist/
- name: Upload binaries
uses: svenstaro/upload-release-action@v2
with:
file: cli/dist/*
file_glob: true
repo_token: ${{ secrets.GH_TOKEN }}
tag: ${{ github.ref }}
cli-windows-build:
name: Build WINDOWS binary
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./cli
steps:
- uses: actions/checkout@v3
- name: Install build dependencies
run: cargo install cross --git https://github.com/cross-rs/cross
- name: Prepare build directory
run: cargo clean
- name: Build windows binary
run: cross build --release --target x86_64-pc-windows-gnu
- name: Shipping windows binary
run: |
mkdir dist/
mv target/x86_64-pc-windows-gnu/release/cbers4asat.exe dist/
- name: Upload binaries
uses: svenstaro/upload-release-action@v2
with:
file: cli/dist/cbers4asat.exe
repo_token: ${{ secrets.GH_TOKEN }}
tag: ${{ github.ref }}
asset_name: cbers4asat.exe