forked from mavlink/mavlink-camera-manager
-
Notifications
You must be signed in to change notification settings - Fork 1
68 lines (55 loc) · 2.12 KB
/
deploy-unix.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
name: Deploy unix
on: [push, pull_request]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-22.04
TARGET: x86_64-unknown-linux-gnu
SUFFIX: linux-desktop
- os: ubuntu-22.04
TARGET: armv7-unknown-linux-gnueabihf
SUFFIX: armv7
- os: ubuntu-22.04
TARGET: aarch64-unknown-linux-gnu
SUFFIX: aarch64
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set directory to safe for git
# Note: Required by vergen (https://crates.io/crates/vergen)
run: git config --global --add safe.directory $GITHUB_WORKSPACE
- name: Use cached dependencies
uses: Swatinem/rust-cache@v2
with:
key: "${{ matrix.os }}-${{ matrix.TARGET }}-${{ hashFiles('**/Cargo.lock') }}"
shared-key: "shared"
- name: Install build dependencies - Rustup
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain stable --profile minimal --target ${{ matrix.TARGET }} -y
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
- name: Install build dependencies - Cross
run: cargo install cross
- name: Building for ${{ matrix.os }} ${{ matrix.target }} (${{ matrix.SUFFIX }})
run: cross build --release --locked --target ${{matrix.target}} --verbose
- name: Prepare files
run: |
mkdir -p upload
cp target/${{ matrix.TARGET }}/release/mavlink-camera-manager upload/mavlink-camera-manager-${{ matrix.SUFFIX }}
- uses: actions/upload-artifact@v4
with:
name: mavlink-camera-manager-${{ matrix.SUFFIX }}
path: upload/*
- uses: svenstaro/upload-release-action@v2
name: Upload binaries to release
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')}}
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: 'upload/mavlink-camera-manager-*'
asset_name: mavlink-camera-manager-${{ matrix.SUFFIX }}
tag: ${{ github.ref }}
overwrite: true
file_glob: true