Skip to content

Commit ab55752

Browse files
committed
github: Add binary kernel binary build and upload
Signed-off-by: Rob Bradford <[email protected]>
1 parent 6596583 commit ab55752

File tree

1 file changed

+72
-0
lines changed

1 file changed

+72
-0
lines changed

.github/workflows/release.yaml

+72
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: Cloud Hypervisor Linux Release
2+
on: [create, push]
3+
4+
jobs:
5+
release:
6+
#if: github.event_name == 'create' && github.event.ref_type == 'tag'
7+
name: Release
8+
runs-on: ubuntu-22.04
9+
steps:
10+
- name: Code checkout
11+
uses: actions/checkout@v4
12+
with:
13+
fetch-depth: 1
14+
- name: Install build tools
15+
run: sudo apt install build-essential flex bison libssl-dev libelf-dev bc gcc-aarch64-linux-gnu
16+
- name: Download config (aarch64)
17+
run: curl https://raw.githubusercontent.com/cloud-hypervisor/cloud-hypervisor/main/resources/linux-config-aarch64 -o .config
18+
- name: Build (aarch64)
19+
run: ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- make Image.gz -j `nproc`
20+
- name: Download config (x86-64)
21+
run: curl https://raw.githubusercontent.com/cloud-hypervisor/cloud-hypervisor/main/resources/linux-config-x86_64 -o .config
22+
- name: Build kernel (x86-64)
23+
run: CFLAGS="-Wa,-mx86-used-note=no" make bzImage -j `nproc`
24+
- name: Create release
25+
id: create_release
26+
uses: actions/create-release@v1
27+
env:
28+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
29+
with:
30+
tag_name: ${{ github.ref }}
31+
release_name: ${{ github.ref }}
32+
draft: true
33+
- name: Upload bzImage for x86_64
34+
id: upload-release-hypervisor-fw
35+
uses: actions/upload-release-asset@v1
36+
env:
37+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38+
with:
39+
upload_url: ${{ steps.create_release.outputs.upload_url }}
40+
asset_path: arch/x86/boot/bzImage
41+
asset_name: bzImage
42+
asset_content_type: application/octet-stream
43+
- name: Upload vmlinux for x86_64
44+
id: upload-release-hypervisor-fw
45+
uses: actions/upload-release-asset@v1
46+
env:
47+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
48+
with:
49+
upload_url: ${{ steps.create_release.outputs.upload_url }}
50+
asset_path: vmlinux
51+
asset_name: vmlinux
52+
asset_content_type: application/octet-stream
53+
- name: Upload Image.gz for aarch64
54+
id: upload-release-hypervisor-fw
55+
uses: actions/upload-release-asset@v1
56+
env:
57+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
58+
with:
59+
upload_url: ${{ steps.create_release.outputs.upload_url }}
60+
asset_path: arch/arm64/boot/Image.gz
61+
asset_name: Image.gz
62+
asset_content_type: application/octet-stream
63+
- name: Upload Image for aarch64
64+
id: upload-release-hypervisor-fw
65+
uses: actions/upload-release-asset@v1
66+
env:
67+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
68+
with:
69+
upload_url: ${{ steps.create_release.outputs.upload_url }}
70+
asset_path: arch/arm64/boot/Image
71+
asset_name: Image
72+
asset_content_type: application/octet-stream

0 commit comments

Comments
 (0)