Build static libs for Linux #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build static libs for Linux | |
on: [ 'workflow_dispatch'] | |
jobs: | |
build_libs: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout source code | |
uses: actions/checkout@v3 | |
- name: Install x86_64 (amd64) Rust toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: nightly | |
override: true | |
target: x86_64-unknown-linux-gnu | |
- name: Build static lib for x86_64 target | |
run: cargo build --target=x86_64-unknown-linux-gnu --release | |
- name: Install aarch64 (arm64) Rust toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: nightly | |
override: true | |
target: aarch64-unknown-linux-gnu | |
- name: Build static lib for aarch64 target | |
run: cargo build --target=aarch64-unknown-linux-gnu --release | |
- name: Rename static libraries | |
run: | | |
cp target/aarch64-unknown-linux-gnu/release/libsummarizer.a libsummarizer-aarch64-unknown-linux-gnu.a | |
cp target/x86_64-unknown-linux-gnu/release/libsummarizer.a libsummarizer-x86_64-unknown-linux-gnu.a | |
- name: Upload x86_64 static library as artifact of the build | |
uses: actions/upload-artifact@v3 | |
with: | |
name: libsummarizer-x86_64-unknown-linux-gnu | |
path: libsummarizer-x86_64-unknown-linux-gnu.a | |
- name: Upload aarch64 static library as artifact of the build | |
uses: actions/upload-artifact@v3 | |
with: | |
name: libsummarizer-aarch64-unknown-linux-gnu | |
path: libsummarizer-aarch64-unknown-linux-gnu.a | |