-
Notifications
You must be signed in to change notification settings - Fork 3
66 lines (62 loc) · 2.5 KB
/
build.yaml
File metadata and controls
66 lines (62 loc) · 2.5 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
62
63
64
65
66
on:
release:
types: [created]
workflow_dispatch:
name: Build and release
jobs:
build_and_test:
name: Rust project - latest
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
targets:
- x86_64-unknown-linux-gnu
- x86_64-unknown-linux-musl
# TODO: fixme
# - aarch64-unknown-linux-gnu
# - aarch64-unknown-linux-musl
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- name: Add dependencies (ssl-dev, etc)
run: sudo apt-get install libssl-dev pkg-config
- name: Install aarch64-buildroot-linux-gnu-gcc for relevant target
if: matrix.targets == 'aarch64-unknown-linux-gnu'
run: sudo apt-get install gcc-aarch64-linux-gnu
- name: Install aarch64-buildroot-linux-musl-gcc for relevant target
if: matrix.targets == 'aarch64-unknown-linux-musl'
run: sudo apt-get install gcc-aarch64-linux-musl
- name: Install musl-gcc for relevant target
if: matrix.targets == 'x86_64-unknown-linux-musl'
run: sudo apt-get install musl-tools
- run: rustup target add ${{ matrix.targets }}
- run: rustup update stable && rustup default stable
- run: cargo build --verbose --target ${{ matrix.targets }}
- name: release
if: github.event_name == 'release'
uses: actions/create-release@0cb9c9b65d5d1901c1f53e5e66eaf4afd303e70e # v1
id: create_release
with:
draft: false
prerelease: false
release_name: ${{ steps.version.outputs.version }}
tag_name: ${{ github.ref }}
body_path: CHANGELOG.md
env:
GITHUB_TOKEN: ${{ github.token }}
- name: upload
if: github.event_name == 'release'
uses: actions/upload-release-asset@e8f9f06c4b078e705bd2ea027f0926603fc9b4d5 # v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: target/${{ matrix.targets }}/kernelci-storage
asset_name: kernelci-storage-${{ matrix.targets }}
asset_content_type: application/octet-stream
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Upload artifacts if not a release
if: github.event_name != 'release'
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: kernelci-storage-${{ matrix.targets }}-${{ github.sha }}
path: target/${{ matrix.targets }}/kernelci-storage