console/.github/workflows/build-rust.yaml
renovate[bot] 6a36737140
chore(deps): update swatinem/rust-cache action to v2 (#898)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-12-27 14:29:11 +02:00

37 lines
932 B
YAML

on:
workflow_call:
jobs:
rust:
runs-on: ubuntu-22.04
steps:
- name: checkout
uses: actions/checkout@v3
- name: install rust
run: |
curl https://sh.rustup.rs -sSf | sh -s -- -y
rustup target add x86_64-unknown-linux-gnu
- name: cache rust
uses: Swatinem/rust-cache@v2
with:
key: rust_linux_cross
- name: cargo build
run: cargo build --target x86_64-unknown-linux-gnu --release
- name: strip binary
run: strip target/x86_64-unknown-linux-gnu/release/router
- name: compress
run:
./target/x86_64-unknown-linux-gnu/release/compress
./target/x86_64-unknown-linux-gnu/release/router ./router.tar.gz
- name: upload artifact
uses: actions/upload-artifact@v3
with:
name: router-linux
path: target/x86_64-unknown-linux-gnu/release/router