|
| 1 | +name: Cloud Hypervisor Linux Release |
| 2 | +on: [create] |
| 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 | + uses: actions/upload-release-asset@v1 |
| 35 | + env: |
| 36 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 37 | + with: |
| 38 | + upload_url: ${{ steps.create_release.outputs.upload_url }} |
| 39 | + asset_path: arch/x86/boot/bzImage |
| 40 | + asset_name: bzImage |
| 41 | + asset_content_type: application/octet-stream |
| 42 | + - name: Upload vmlinux for x86_64 |
| 43 | + uses: actions/upload-release-asset@v1 |
| 44 | + env: |
| 45 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 46 | + with: |
| 47 | + upload_url: ${{ steps.create_release.outputs.upload_url }} |
| 48 | + asset_path: vmlinux |
| 49 | + asset_name: vmlinux |
| 50 | + asset_content_type: application/octet-stream |
| 51 | + - name: Upload Image.gz for aarch64 |
| 52 | + uses: actions/upload-release-asset@v1 |
| 53 | + env: |
| 54 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 55 | + with: |
| 56 | + upload_url: ${{ steps.create_release.outputs.upload_url }} |
| 57 | + asset_path: arch/arm64/boot/Image.gz |
| 58 | + asset_name: Image.gz |
| 59 | + asset_content_type: application/octet-stream |
| 60 | + - name: Upload Image for aarch64 |
| 61 | + uses: actions/upload-release-asset@v1 |
| 62 | + env: |
| 63 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 64 | + with: |
| 65 | + upload_url: ${{ steps.create_release.outputs.upload_url }} |
| 66 | + asset_path: arch/arm64/boot/Image |
| 67 | + asset_name: Image |
| 68 | + asset_content_type: application/octet-stream |
0 commit comments