-
Notifications
You must be signed in to change notification settings - Fork 165
202 lines (171 loc) · 6.9 KB
/
CreateRelease.yml
File metadata and controls
202 lines (171 loc) · 6.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: Create a Release
on:
workflow_dispatch:
push:
branches: [main]
permissions:
contents: write
issues: read
jobs:
release-blocker-check:
# see https://github.com/orgs/community/discussions/26286#discussioncomment-3251208 for why we need to check the ref
if: ${{ contains(github.ref, 'refs/heads/release/') }} || ${{ github.ref=='refs/heads/main' }}
uses: ./.github/workflows/ReleaseBlockerCheck.yml
with:
repository: ${{ github.repository }}
secrets: inherit
build-rust-ubuntu:
# see https://github.com/orgs/community/discussions/26286#discussioncomment-3251208 for why we need to check the ref
if: ${{ contains(github.ref, 'refs/heads/release/') }} || ${{ github.ref=='refs/heads/main' }}
runs-on: [self-hosted, Linux, X64, "1ES.Pool=hld-kvm-amd", "JobId=build-rust-ubuntu-${{ github.run_id }}-${{ github.run_number }}-${{ github.run_attempt }}"]
needs: [release-blocker-check]
steps:
- uses: actions/checkout@v6
- uses: hyperlight-dev/ci-setup-workflow@v1.9.0
with:
rust-toolchain: "1.89"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build Debug
run: cargo build --verbose
- name: Build Release
run: cargo build --verbose --release
build-rust-windows:
# see https://github.com/orgs/community/discussions/26286#discussioncomment-3251208 for why we need to check the ref
if: ${{ contains(github.ref, 'refs/heads/release/') }} || ${{ github.ref=='refs/heads/main' }}
runs-on: windows-2025
needs: [release-blocker-check]
steps:
- uses: actions/checkout@v6
- uses: hyperlight-dev/ci-setup-workflow@v1.9.0
with:
rust-toolchain: "1.89"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build Debug
run: cargo build --verbose
- name: Build Release
run: cargo build --verbose --release
build-guests:
uses: ./.github/workflows/dep_build_guests.yml
secrets: inherit
needs: [release-blocker-check]
with:
config: release
benchmarks:
needs: [build-guests]
strategy:
fail-fast: true
matrix:
hypervisor: ['hyperv-ws2025', mshv3, kvm]
cpu: [amd, intel]
uses: ./.github/workflows/dep_benchmarks.yml
secrets: inherit
with:
hypervisor: ${{ matrix.hypervisor }}
cpu: ${{ matrix.cpu }}
permissions:
contents: read
cargo-publish:
needs: [publish]
uses: ./.github/workflows/CargoPublish.yml
with:
dry_run: false
secrets: inherit
permissions:
contents: read
id-token: write
publish:
# see https://github.com/orgs/community/discussions/26286#discussioncomment-3251208 for why we need to check the ref
if: ${{ contains(github.ref, 'refs/heads/release/') }} || ${{ github.ref=='refs/heads/main' }}
runs-on: [self-hosted, Linux, X64, "1ES.Pool=hld-kvm-amd", "JobId=create-release-publish-${{ github.run_id }}-${{ github.run_number }}-${{ github.run_attempt }}"]
needs:
[
build-rust-ubuntu,
build-rust-windows,
benchmarks,
]
steps:
- name: Set Debug Configuration
if: ${{ github.ref=='refs/heads/main' }}
run: echo "CONFIG=debug" >> $GITHUB_ENV
- name: Set Release Configuration
if: ${{ contains(github.ref, 'refs/heads/release/') }}
run: echo "CONFIG=release" >> $GITHUB_ENV
- uses: actions/checkout@v6
with:
fetch-depth: 0
fetch-tags: true
- uses: hyperlight-dev/ci-setup-workflow@v1.9.0
with:
rust-toolchain: "1.89"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# HYPERLIGHT_VERSION does not include the v prefix
- name: Set HYPERLIGHT_VERSION
if: ${{ contains(github.ref, 'refs/heads/release/') }}
id: set_hyperlight_version
run: |
git fetch --tags
version=$(echo "${{ github.ref }}" | sed -E 's#refs/heads/release/v##')
echo "HYPERLIGHT_VERSION=$version" >> $GITHUB_ENV
echo "HYPERLIGHT_VERSION=$version"
- name: Build and archive guest library + header files
run: |
just tar-headers
just tar-static-lib
- name: Download all benchmarks
uses: actions/download-artifact@v8
with:
pattern: benchmarks_*
- name: Archive benchmarks
run: |
# windows (server 2025)
tar -zcvf benchmarks_Windows_hyperv-ws2025_amd.tar.gz benchmarks_Windows_hyperv-ws2025_amd
tar -zcvf benchmarks_Windows_hyperv-ws2025_intel.tar.gz benchmarks_Windows_hyperv-ws2025_intel
# kvm
tar -zcvf benchmarks_Linux_kvm_amd.tar.gz benchmarks_Linux_kvm_amd
tar -zcvf benchmarks_Linux_kvm_intel.tar.gz benchmarks_Linux_kvm_intel
# mshv3
tar -zcvf benchmarks_Linux_mshv3_amd.tar.gz benchmarks_Linux_mshv3_amd
tar -zcvf benchmarks_Linux_mshv3_intel.tar.gz benchmarks_Linux_mshv3_intel
- name: Extract release notes from changelog
if: ${{ contains(github.ref, 'refs/heads/release/') }}
run: just create-release-notes v${{ env.HYPERLIGHT_VERSION }} > RELEASE_NOTES.md
env:
GH_TOKEN: ${{ github.token }}
- name: Extract prerelease notes from changelog
if: ${{ github.ref=='refs/heads/main' }}
run: just create-release-notes dev-latest > RELEASE_NOTES.md
env:
GH_TOKEN: ${{ github.token }}
- name: Create release
if: ${{ contains(github.ref, 'refs/heads/release/') }}
run: |
gh release create v${{ env.HYPERLIGHT_VERSION }} -t "Release v${{ env.HYPERLIGHT_VERSION }}" --notes-file RELEASE_NOTES.md \
benchmarks_Windows_hyperv-ws2025_amd.tar.gz \
benchmarks_Windows_hyperv-ws2025_intel.tar.gz \
benchmarks_Linux_kvm_amd.tar.gz \
benchmarks_Linux_kvm_intel.tar.gz \
benchmarks_Linux_mshv3_amd.tar.gz \
benchmarks_Linux_mshv3_intel.tar.gz \
hyperlight-guest-c-api-linux.tar.gz \
include.tar.gz
env:
GH_TOKEN: ${{ github.token }}
- name: Create prerelease
if: ${{ github.ref=='refs/heads/main' }}
run: |
gh release delete dev-latest -y --cleanup-tag || true
gh release create dev-latest -t "Latest prerelease from main branch" --notes-file RELEASE_NOTES.md --latest=false -p \
benchmarks_Windows_hyperv-ws2025_amd.tar.gz \
benchmarks_Windows_hyperv-ws2025_intel.tar.gz \
benchmarks_Linux_kvm_amd.tar.gz \
benchmarks_Linux_kvm_intel.tar.gz \
benchmarks_Linux_mshv3_amd.tar.gz \
benchmarks_Linux_mshv3_intel.tar.gz \
hyperlight-guest-c-api-linux.tar.gz \
include.tar.gz
env:
GH_TOKEN: ${{ github.token }}