Skip to content

Commit c429933

Browse files
committed
feat: add release step
1 parent 3c19023 commit c429933

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

.github/workflows/build-kernel.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,18 @@ on:
77
description: "WSL2 kernel version (e.g. 5.15.90.4)"
88
required: true
99
default: "5.15.90.4"
10+
release_tag:
11+
description: "GitHub Release tag (e.g. v5.15.90.4)"
12+
required: true
13+
default: "v5.15.90.4"
1014

1115
jobs:
1216
build:
1317
runs-on: ubuntu-latest
1418
env:
1519
KERNEL_VERSION: ${{ github.event.inputs.kernel_version }}
1620
KERNEL_DIR: linux-${{ github.event.inputs.kernel_version }}
21+
RELEASE_TAG: ${{ github.event.inputs.release_tag }}
1722

1823
steps:
1924
- uses: actions/checkout@v4
@@ -61,3 +66,34 @@ jobs:
6166
with:
6267
name: wsl2-kernel-${{ env.KERNEL_VERSION }}
6368
path: artifact
69+
70+
- name: Create Release
71+
id: create_release
72+
uses: actions/create-release@v1
73+
env:
74+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
75+
with:
76+
tag_name: ${{ env.RELEASE_TAG }}
77+
release_name: "WSL2 Kernel ${{ env.KERNEL_VERSION }}"
78+
draft: false
79+
prerelease: false
80+
81+
- name: Upload Kernel Image
82+
uses: actions/upload-release-asset@v1
83+
env:
84+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
85+
with:
86+
upload_url: ${{ steps.create_release.outputs.upload_url }}
87+
asset_path: ${{ env.KERNEL_DIR }}/arch/x86/boot/bzImage
88+
asset_name: bzImage-${{ env.KERNEL_VERSION }}
89+
asset_content_type: application/octet-stream
90+
91+
- name: Upload Kernel Config
92+
uses: actions/upload-release-asset@v1
93+
env:
94+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
95+
with:
96+
upload_url: ${{ steps.create_release.outputs.upload_url }}
97+
asset_path: ${{ env.KERNEL_DIR }}/.config
98+
asset_name: config-${{ env.KERNEL_VERSION }}.txt
99+
asset_content_type: text/plain

0 commit comments

Comments
 (0)