|
1 | 1 | name: Build and Release WSL2 Kernel |
| 2 | + |
2 | 3 | run-name: Build (${{ github.event.inputs.kernel_version }}) |
3 | 4 |
|
4 | 5 | on: |
|
14 | 15 | runs-on: ubuntu-latest |
15 | 16 | permissions: |
16 | 17 | contents: write |
17 | | - actions: read |
18 | | - packages: write |
19 | 18 | env: |
20 | 19 | KERNEL_VERSION: ${{ github.event.inputs.kernel_version }} |
21 | 20 | KERNEL_DIR: linux-${{ github.event.inputs.kernel_version }} |
@@ -54,50 +53,37 @@ jobs: |
54 | 53 | run: | |
55 | 54 | cd ${{ env.KERNEL_DIR }} |
56 | 55 | make -j$(nproc) LDFLAGS="-z noexecstack -z separate-code" LD=ld.bfd |
| 56 | + echo "BUILD_DATE=$(date -u +'%Y-%m-%d %H:%M:%S')" >> $GITHUB_ENV |
57 | 57 |
|
58 | | - - name: Verify Build Artifacts |
| 58 | + - name: Generate Release Notes |
59 | 59 | run: | |
60 | | - ls -lh ${{ env.KERNEL_DIR }}/arch/x86/boot/bzImage |
61 | | - ls -lh ${{ env.KERNEL_DIR }}/.config |
| 60 | + cat << EOF > release_notes.md |
| 61 | + # WSL2 Kernel ${{ env.KERNEL_VERSION }} |
| 62 | +
|
| 63 | + ### Build Information |
| 64 | + - Version: ${{ env.KERNEL_VERSION }} |
| 65 | + - Build Date: ${{ env.BUILD_DATE }} |
| 66 | + - Source: [Microsoft/WSL2-Linux-Kernel@${{ env.KERNEL_VERSION }}](https://github.com/microsoft/WSL2-Linux-Kernel/tree/linux-msft-wsl-${{ env.KERNEL_VERSION }}) |
| 67 | +
|
| 68 | + ### Installation |
| 69 | + 1. Download \`bzImage\` |
| 70 | + 2. Place in \`C:\Windows\System32\lxss\tools\` |
| 71 | + 3. Add to \`.wslconfig\`: |
| 72 | + \`\`\`ini |
| 73 | + [wsl2] |
| 74 | + kernel=C:\\Windows\\System32\\lxss\\tools\\bzImage |
| 75 | + \`\`\` |
| 76 | + EOF |
62 | 77 |
|
63 | | - - name: Create GitHub Release |
64 | | - id: create_release |
65 | | - uses: actions/create-release@v2 |
66 | | - env: |
67 | | - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 78 | + - name: Create Release and Upload Assets |
| 79 | + uses: softprops/action-gh-release@v2 |
68 | 80 | with: |
69 | 81 | tag_name: ${{ env.RELEASE_TAG }} |
70 | | - release_name: "WSL2 Kernel ${{ env.KERNEL_VERSION }}" |
71 | | - body: | |
72 | | - ### Build Information |
73 | | - - Version: ${{ env.KERNEL_VERSION }} |
74 | | - - Build Date: $(date -u +'%Y-%m-%d %H:%M:%S') |
75 | | -
|
76 | | - ### Installation |
77 | | - 1. Download `bzImage` |
78 | | - 2. Place in `C:\Windows\System32\lxss\tools` |
79 | | - 3. Add to `.wslconfig`: |
80 | | - ```ini |
81 | | - [wsl2] |
82 | | - kernel=C:\\Windows\\System32\\lxss\\tools\\bzImage |
83 | | - ``` |
| 82 | + name: "WSL2 Kernel ${{ env.KERNEL_VERSION }}" |
| 83 | + body_path: release_notes.md |
| 84 | + files: | |
| 85 | + ${{ env.KERNEL_DIR }}/arch/x86/boot/bzImage |
| 86 | + ${{ env.KERNEL_DIR }}/.config |
84 | 87 | draft: false |
85 | 88 | prerelease: false |
86 | | - |
87 | | - - name: Upload Release Assets |
88 | | - |
89 | | - env: |
90 | | - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
91 | | - with: |
92 | | - asset_paths: | |
93 | | - [ |
94 | | - "${{ env.KERNEL_DIR }}/arch/x86/boot/bzImage", |
95 | | - "${{ env.KERNEL_DIR }}/.config", |
96 | | - "${{ env.KERNEL_DIR }}/build.log" |
97 | | - ] |
98 | | - asset_names: | |
99 | | - [ |
100 | | - "bzImage-${{ env.KERNEL_VERSION }}", |
101 | | - "config-${{ env.KERNEL_VERSION }}.txt", |
102 | | - "build-log-${{ env.KERNEL_VERSION }}.txt" |
103 | | - ] |
| 89 | + fail_on_unmatched_files: true |
0 commit comments