Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f28c7a3

Browse files
authored
ci(pvm-guest): upload vmlinux to GitHub Release on tag push (#123)
Add push.tags trigger and a publish job that downloads the vmlinux-pvm artifact produced by the build job and uploads it to the GitHub Release, mirroring the pattern used by release-pvm-host-kernel.yml. The build job exposes artifact_name as a job output so the publish job can reference it directly without recomputing source hashes. Signed-off-by: ls-ggg <[email protected]>
1 parent ebe832d commit f28c7a3

1 file changed

Lines changed: 42 additions & 0 deletions

File tree

.github/workflows/build-pvm-guest-vmlinux.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ on:
77
- 'deploy/pvm/common.sh'
88
- 'deploy/pvm/configs/pvm_guest'
99
- '.github/workflows/build-pvm-guest-vmlinux.yml'
10+
tags:
11+
- '*'
1012
workflow_dispatch:
1113

1214
env:
@@ -18,6 +20,8 @@ jobs:
1820
runs-on: ubuntu-latest
1921
permissions:
2022
contents: read
23+
outputs:
24+
artifact_name: ${{ steps.pvm_vmlinux_metadata.outputs.artifact_name }}
2125

2226
steps:
2327
- name: Checkout
@@ -79,3 +83,41 @@ jobs:
7983
path: pvm-vmlinux-artifact/vmlinux-pvm
8084
if-no-files-found: error
8185
retention-days: 14
86+
87+
publish:
88+
name: Upload PVM guest vmlinux to GitHub Release
89+
if: startsWith(github.ref, 'refs/tags/')
90+
needs: build
91+
runs-on: ubuntu-latest
92+
permissions:
93+
contents: write
94+
95+
steps:
96+
- name: Download PVM vmlinux artifact
97+
uses: actions/download-artifact@v4
98+
with:
99+
name: ${{ needs.build.outputs.artifact_name }}
100+
path: pvm-guest-release-assets
101+
102+
- name: Verify release asset
103+
run: |
104+
test -f pvm-guest-release-assets/vmlinux-pvm
105+
ls -lh pvm-guest-release-assets/vmlinux-pvm
106+
107+
- name: Ensure GitHub Release exists
108+
env:
109+
GH_TOKEN: ${{ github.token }}
110+
run: |
111+
if ! gh release view "${GITHUB_REF_NAME}" >/dev/null 2>&1; then
112+
gh release create "${GITHUB_REF_NAME}" \
113+
--title "${GITHUB_REF_NAME}" \
114+
--notes "Automated release."
115+
fi
116+
117+
- name: Upload PVM guest vmlinux to Release
118+
env:
119+
GH_TOKEN: ${{ github.token }}
120+
run: |
121+
gh release upload "${GITHUB_REF_NAME}" \
122+
pvm-guest-release-assets/vmlinux-pvm \
123+
--clobber

0 commit comments

Comments
 (0)