-
Notifications
You must be signed in to change notification settings - Fork 0
94 lines (85 loc) · 2.71 KB
/
build.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
name: Build Kernel
on: [push, pull_request]
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: Configure Rustup
run: |
echo ::group::Rustup Nightly
rustup override set nightly
echo ::endgroup::
echo ::group::Rustup add rust-src
rustup component add rust-src
echo ::endgroup::
- name: Install Xargo
run: cargo install xargo
- name: Install Arm GNU Toolchain (arm-none-eabi-gcc)
uses: carlosperate/arm-none-eabi-gcc-action@v1
- name: Build Kernel
run: |
bash ./build
- name: Upload Kernel
uses: actions/upload-artifact@v2
with:
name: kernel
path: ./target/kernel.img
- name: Upload Full Image ZIP (with firmware)
uses: actions/upload-artifact@v2
with:
name: kernel-with-firmware
path: |
./target/kernel.img
./firmware/start.elf
./firmware/fixup.dat
./firmware/bootcode.bin
./firmware/LICENCE.broadcom
release:
name: Publish Release
needs: build
if: success() && github.event_name == 'push' && contains(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v3
with:
name: kernel
path: kernel
- uses: actions/download-artifact@v3
with:
name: kernel-with-firmware
path: kernel-with-firmware
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
draft: false
prerelease: false
- name: Upload Kernel
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./kernel/kernel.img
asset_name: kernel.img
asset_content_type: application/octet-stream
- name: Zip Kernel with Firmware
run: zip -r kernel-with-firmware.zip kernel-with-firmware
- name: Upload Kernel with Firmware
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./kernel-with-firmware.zip
asset_name: kernel-with-firmware.zip
asset_content_type: application/zip