Skip to content

Commit d16bff3

Browse files
committed
fix: using softprops/action-gh-release@v2
1 parent 8aae188 commit d16bff3

File tree

1 file changed

+28
-42
lines changed

1 file changed

+28
-42
lines changed

.github/workflows/build-kernel.yml

Lines changed: 28 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
name: Build and Release WSL2 Kernel
2+
23
run-name: Build (${{ github.event.inputs.kernel_version }})
34

45
on:
@@ -14,8 +15,6 @@ jobs:
1415
runs-on: ubuntu-latest
1516
permissions:
1617
contents: write
17-
actions: read
18-
packages: write
1918
env:
2019
KERNEL_VERSION: ${{ github.event.inputs.kernel_version }}
2120
KERNEL_DIR: linux-${{ github.event.inputs.kernel_version }}
@@ -54,50 +53,37 @@ jobs:
5453
run: |
5554
cd ${{ env.KERNEL_DIR }}
5655
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
5757
58-
- name: Verify Build Artifacts
58+
- name: Generate Release Notes
5959
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
6277
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
6880
with:
6981
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
8487
draft: false
8588
prerelease: false
86-
87-
- name: Upload Release Assets
88-
uses: alexellis/[email protected]
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

Comments
 (0)