78
78
publish :
79
79
# see https://github.com/orgs/community/discussions/26286#discussioncomment-3251208 for why we need to check the ref
80
80
if : ${{ contains(github.ref, 'refs/heads/release/') }} || ${{ github.ref=='refs/heads/main' }}
81
- runs-on : windows-2022
81
+ runs-on : [self-hosted, Linux, X64, "1ES.Pool=hld-kvm-amd"]
82
82
needs :
83
83
[
84
84
build-rust-ubuntu,
@@ -90,13 +90,11 @@ jobs:
90
90
steps :
91
91
- name : Set Debug Configuration
92
92
if : ${{ github.ref=='refs/heads/main' }}
93
- run : echo "CONFIG=debug" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
94
- shell : pwsh
93
+ run : echo "CONFIG=debug" >> $GITHUB_ENV
95
94
96
95
- name : Set Release Configuration
97
96
if : ${{ contains(github.ref, 'refs/heads/release/') }}
98
- run : echo "CONFIG=release" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
99
- shell : pwsh
97
+ run : echo "CONFIG=release" >> $GITHUB_ENV
100
98
101
99
- uses : actions/checkout@v4
102
100
with :
@@ -115,21 +113,9 @@ jobs:
115
113
id : set_hyperlight_version
116
114
run : |
117
115
git fetch --tags
118
- $version="${{ github.ref }}"
119
- $version=$version -replace "refs/heads/release/v", ""
120
- echo "HYPERLIGHT_VERSION=$version" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
121
- echo "HYPERLIGHT_VERSION=$Env:HYPERLIGHT_VERSION"
122
- shell : pwsh
123
-
124
- - name : Ensure path exists for debug build
125
- if : ${{ env.CONFIG }} == "debug"
126
- run : mkdir -p target\debug
127
- shell : pwsh
128
-
129
- - name : Ensure path exists for release build
130
- if : ${{ env.CONFIG }} == "release"
131
- run : mkdir -p target\release
132
- shell : pwsh
116
+ version=$(echo "${{ github.ref }}" | sed -E 's#refs/heads/release/v##')
117
+ echo "HYPERLIGHT_VERSION=$version" >> $GITHUB_ENV
118
+ echo "HYPERLIGHT_VERSION=$version"
133
119
134
120
- name : Download Guest Binaries
135
121
uses : actions/download-artifact@v4
@@ -154,7 +140,6 @@ jobs:
154
140
uses : actions/download-artifact@v4
155
141
with :
156
142
pattern : benchmarks_*
157
- # note: artifacts retain their upload name, so we don't have to specify the path
158
143
159
144
- name : Archive benchmarks
160
145
run : |
@@ -163,74 +148,55 @@ jobs:
163
148
tar -zcvf benchmarks_Linux_kvm_amd.tar.gz benchmarks_Linux_kvm_amd
164
149
tar -zcvf benchmarks_Windows_hyperv_intel.tar.gz benchmarks_Windows_hyperv_intel
165
150
tar -zcvf benchmarks_Linux_hyperv_intel.tar.gz benchmarks_Linux_hyperv_intel
166
- tar -zcvf benchmarks_Linux_kvm_intel.tar.gz benchmarks_Linux_kvm_intel
167
-
168
- - name : Install github-cli
169
- run : |
170
- $ProgressPreference = 'SilentlyContinue'
171
- # check if gh cli is installed
172
- $installed = [bool](Get-Command -ErrorAction Ignore -Type Application gh)
173
- if ($installed) { Write-Host "gh cli already installed"; exit 0 }
174
- # download and install gh cli
175
- Invoke-WebRequest https://github.com/cli/cli/releases/download/v2.50.0/gh_2.50.0_windows_amd64.msi -OutFile gh.msi
176
- msiexec.exe /i gh.msi /quiet /l log.txt | Out-Null
177
- Write-Host "msiexec exited with code $LASTEXITCCODE"
178
- if ($LASTEXITCODE -ne 0) { cat log.txt; exit 1 }
151
+ tar -zcvf benchmarks_Linux_kvm_intel.tar.gz benchmarks_Linux_kvm_intel
179
152
180
153
- name : Extract release notes from changelog
181
154
if : ${{ contains(github.ref, 'refs/heads/release/') }}
182
- run : |
183
- # Extract the changelog from the changelog file
184
- just create-release-notes v${{ env.HYPERLIGHT_VERSION }} > RELEASE_NOTES.md
155
+ run : just create-release-notes v${{ env.HYPERLIGHT_VERSION }} > RELEASE_NOTES.md
185
156
186
157
- name : Extract prerelease notes from changelog
187
158
if : ${{ github.ref=='refs/heads/main' }}
188
- run : |
189
- # Extract the changelog from the changelog file
190
- just create-release-notes dev-latest > RELEASE_NOTES.md
159
+ run : just create-release-notes dev-latest > RELEASE_NOTES.md
191
160
192
- # Publish the native guests so that its possible to use Hyperlight without building it.
193
161
- name : Create release
194
- # Only create a release from tag if we are on a release branch
195
162
if : ${{ contains(github.ref, 'refs/heads/release/') }}
196
163
run : |
197
- gh release create v${{ env.HYPERLIGHT_VERSION }} -t "Release v${{ env.HYPERLIGHT_VERSION }}" --notes-file RELEASE_NOTES.md `
198
- src/tests/rust_guests/bin/${{ env.CONFIG }}/callbackguest `
199
- src/tests/rust_guests/bin/${{ env.CONFIG }}/callbackguest.exe `
200
- src/tests/rust_guests/bin/${{ env.CONFIG }}/simpleguest `
201
- src/tests/rust_guests/bin/${{ env.CONFIG }}/simpleguest.exe `
202
- src/tests/rust_guests/bin/${{ env.CONFIG }}/dummyguest `
203
- benchmarks_Windows_hyperv_amd.tar.gz `
204
- benchmarks_Linux_hyperv_amd.tar.gz `
205
- benchmarks_Linux_kvm_amd.tar.gz `
206
- benchmarks_Windows_hyperv_intel.tar.gz `
207
- benchmarks_Linux_hyperv_intel.tar.gz `
208
- benchmarks_Linux_kvm_intel.tar.gz `
209
- hyperlight-guest-c-api-linux.tar.gz `
210
- hyperlight-guest-c-api-windows.tar.gz `
164
+ gh release create v${{ env.HYPERLIGHT_VERSION }} -t "Release v${{ env.HYPERLIGHT_VERSION }}" --notes-file RELEASE_NOTES.md \
165
+ src/tests/rust_guests/bin/${{ env.CONFIG }}/callbackguest \
166
+ src/tests/rust_guests/bin/${{ env.CONFIG }}/callbackguest.exe \
167
+ src/tests/rust_guests/bin/${{ env.CONFIG }}/simpleguest \
168
+ src/tests/rust_guests/bin/${{ env.CONFIG }}/simpleguest.exe \
169
+ src/tests/rust_guests/bin/${{ env.CONFIG }}/dummyguest \
170
+ benchmarks_Windows_hyperv_amd.tar.gz \
171
+ benchmarks_Linux_hyperv_amd.tar.gz \
172
+ benchmarks_Linux_kvm_amd.tar.gz \
173
+ benchmarks_Windows_hyperv_intel.tar.gz \
174
+ benchmarks_Linux_hyperv_intel.tar.gz \
175
+ benchmarks_Linux_kvm_intel.tar.gz \
176
+ hyperlight-guest-c-api-linux.tar.gz \
177
+ hyperlight-guest-c-api-windows.tar.gz \
211
178
include.tar.gz
212
179
env :
213
180
GH_TOKEN : ${{ github.token }}
181
+
214
182
- name : Create prerelease
215
- # Only create a prerelease if we are on the main branch
216
183
if : ${{ github.ref=='refs/heads/main' }}
217
- run : |
218
- gh release delete dev-latest -y --cleanup-tag || $ true
219
- gh release create dev-latest -t "Latest prerelease from main branch" --notes-file RELEASE_NOTES.md --latest=false -p `
220
- src/tests/rust_guests/bin/${{ env.CONFIG }}/callbackguest `
221
- src/tests/rust_guests/bin/${{ env.CONFIG }}/callbackguest.exe `
222
- src/tests/rust_guests/bin/${{ env.CONFIG }}/simpleguest `
223
- src/tests/rust_guests/bin/${{ env.CONFIG }}/simpleguest.exe `
224
- src/tests/rust_guests/bin/${{ env.CONFIG }}/dummyguest `
225
- benchmarks_Windows_hyperv_amd.tar.gz `
226
- benchmarks_Linux_hyperv_amd.tar.gz `
227
- benchmarks_Linux_kvm_amd.tar.gz `
228
- benchmarks_Windows_hyperv_intel.tar.gz `
229
- benchmarks_Linux_hyperv_intel.tar.gz `
230
- benchmarks_Linux_kvm_intel.tar.gz `
231
- hyperlight-guest-c-api-linux.tar.gz `
232
- hyperlight-guest-c-api-windows.tar.gz `
184
+ run : |
185
+ gh release delete dev-latest -y --cleanup-tag || true
186
+ gh release create dev-latest -t "Latest prerelease from main branch" --notes-file RELEASE_NOTES.md --latest=false -p \
187
+ src/tests/rust_guests/bin/${{ env.CONFIG }}/callbackguest \
188
+ src/tests/rust_guests/bin/${{ env.CONFIG }}/callbackguest.exe \
189
+ src/tests/rust_guests/bin/${{ env.CONFIG }}/simpleguest \
190
+ src/tests/rust_guests/bin/${{ env.CONFIG }}/simpleguest.exe \
191
+ src/tests/rust_guests/bin/${{ env.CONFIG }}/dummyguest \
192
+ benchmarks_Windows_hyperv_amd.tar.gz \
193
+ benchmarks_Linux_hyperv_amd.tar.gz \
194
+ benchmarks_Linux_kvm_amd.tar.gz \
195
+ benchmarks_Windows_hyperv_intel.tar.gz \
196
+ benchmarks_Linux_hyperv_intel.tar.gz \
197
+ benchmarks_Linux_kvm_intel.tar.gz \
198
+ hyperlight-guest-c-api-linux.tar.gz \
199
+ hyperlight-guest-c-api-windows.tar.gz \
233
200
include.tar.gz
234
201
env :
235
202
GH_TOKEN : ${{ github.token }}
236
-
0 commit comments