Skip to content

Commit

Permalink
chore: Update Docker and rust workflow; add Rust Tests & Linting work…
Browse files Browse the repository at this point in the history
…flow
  • Loading branch information
KlementXV committed Aug 15, 2024
1 parent c50d429 commit eb943a6
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 14 deletions.
85 changes: 76 additions & 9 deletions .github/workflows/rust-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ name: Rust Build
on:
release:
types: [published]
push:


env:
CARGO_TERM_COLOR: always
Expand Down Expand Up @@ -72,9 +74,6 @@ jobs:
name: ${{ env.BINARY_NAME }}-${{ needs.version.outputs.version }}-${{ matrix.target }}
path: target/dist/*

- name: Debug - Check file existence
run: ls -alh target/dist

- name: Upload release asset
uses: actions/upload-release-asset@v1
with:
Expand Down Expand Up @@ -130,9 +129,6 @@ jobs:
name: ${{ env.BINARY_NAME }}-${{ needs.version.outputs.version }}-${{ matrix.target }}
path: target/dist/*

- name: Debug - Check file existence
run: ls -alh target/dist

- name: Upload release asset
uses: actions/upload-release-asset@v1
with:
Expand Down Expand Up @@ -179,15 +175,86 @@ jobs:
name: ${{ env.BINARY_NAME }}-${{ needs.version.outputs.version }}-x86_64-pc-windows-msvc
path: target/dist/*

- name: Debug - Check file existence
run: Get-ChildItem -Path target/dist

- name: Upload release asset
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: target/dist/${{ env.BINARY_NAME }}-${{ needs.version.outputs.version }}-x86_64-pc-windows-msvc.exe
asset_name: ${{ env.BINARY_NAME }}-${{ needs.version.outputs.version }}-x86_64-pc-windows-msvc.exe
asset_content_type: application/octet-stream
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

build-arm64:
name: Build on ARM64 (Ubuntu 22.04)
needs: version
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
tool-cache: true

- name: Setup Rust
run: |
curl https://sh.rustup.rs -sSf | sh -s -- -y
source "$HOME/.cargo/env"
rustup target add aarch64-unknown-linux-gnu
- name: Install dependencies
run: |
sudo apt-get update && sudo apt-get install -y \
musl-tools \
clang \
gcc-aarch64-linux-gnu \
g++-aarch64-linux-gnu \
libc6-dev \
libc6-dev-arm64-cross
- name: Configure cache
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: release-${{ runner.os }}-cargo-aarch64-unknown-linux-gnu-${{ hashFiles('**/Cargo.lock') }}

- name: Build
run: |
env BINDGEN_EXTRA_CLANG_ARGS='--sysroot /usr/aarch64-linux-gnu' \
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=/usr/bin/aarch64-linux-gnu-gcc \
cargo build --release --target aarch64-unknown-linux-gnu
- name: Strip binary
run: strip target/aarch64-unknown-linux-gnu/release/${{ env.BINARY_NAME }}

- name: Package
run: |
rm -rf target/dist
mkdir -p target/dist
cp target/aarch64-unknown-linux-gnu/release/${{ env.BINARY_NAME }} target/dist/${{ env.BINARY_NAME }}-${{ needs.version.outputs.version }}-aarch64-unknown-linux-gnu
- name: Upload archive
uses: actions/upload-artifact@v4
with:
name: ${{ env.BINARY_NAME }}-${{ needs.version.outputs.version }}-aarch64-unknown-linux-gnu
path: target/dist/*

- name: Debug - Check file existence
run: ls -alh target/dist

- name: Upload release asset
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: target/dist/${{ env.BINARY_NAME }}-${{ needs.version.outputs.version }}-aarch64-unknown-linux-gnu
asset_name: ${{ env.BINARY_NAME }}-${{ needs.version.outputs.version }}-aarch64-unknown-linux-gnu
asset_content_type: application/octet-stream
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5 changes: 0 additions & 5 deletions .github/workflows/rust-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@ name: Rust Tests & Linting

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
build_and_test:
Expand Down

0 comments on commit eb943a6

Please sign in to comment.