forked from OpenCentauri/OpenCentauri
-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (53 loc) · 1.7 KB
/
Copy pathbuild-rust.yml
File metadata and controls
61 lines (53 loc) · 1.7 KB
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
name: --internal-build-rust-project
on:
workflow_call:
inputs:
project:
required: true
type: string
jobs:
build:
name: Build - ${{ inputs.project }} - ${{ matrix.platform.os-name }}
runs-on: ${{ matrix.platform.runs-on }}
strategy:
matrix:
platform:
- os-name: linux-armv7
runs-on: ubuntu-24.04
target: armv7-unknown-linux-musleabihf
- os-name: linux-aarch64
runs-on: ubuntu-24.04
target: aarch64-unknown-linux-musl
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Build debug binary
uses: houseabsolute/actions-rust-cross@v1
with:
command: build
target: ${{ matrix.platform.target }}
args: "--locked"
strip: true
working-directory: ${{ inputs.project }}
- name: Build release binary
uses: houseabsolute/actions-rust-cross@v1
with:
command: build
target: ${{ matrix.platform.target }}
args: "--locked --release"
strip: true
working-directory: ${{ inputs.project }}
- name: Package
env:
PROJECT: ${{ inputs.project }}
PLATFORM: ${{ matrix.platform.os-name }}
TARGET: ${{ matrix.platform.target }}
run: |
mkdir package
mv "$PROJECT/target/$TARGET/debug/$PROJECT" "package/$PROJECT-$PLATFORM-debug"
mv "$PROJECT/target/$TARGET/release/$PROJECT" "package/$PROJECT-$PLATFORM"
- name: Upload binary
uses: actions/upload-artifact@v6
with:
name: ${{ inputs.project }}-${{ matrix.platform.os-name }}
path: package/*