-
Notifications
You must be signed in to change notification settings - Fork 39
128 lines (124 loc) · 5.06 KB
/
Copy pathCreateRelease.yml
File metadata and controls
128 lines (124 loc) · 5.06 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
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: Create a Release
on:
workflow_dispatch:
push:
branches: [ release/**, dev ]
permissions:
contents: write
packages: write
jobs:
benchmarks:
uses: ./.github/workflows/Benchmarks.yml
publish:
needs: [ benchmarks ]
runs-on: windows-latest
strategy:
matrix:
config: [debug, release]
env:
PLATFORM: x64
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
# Ensures just is installed using setup wokflow to ensure just version consistency
- name: Hyperlight setup
uses: hyperlight-dev/ci-setup-workflow@v1.5.0
with:
rust-toolchain: "1.85.0"
- name: Install minver_rs
run: |
cargo install minver_rs
shell: pwsh
- name: Set HYPERLIGHTWASM_VERSION
run: |
git fetch --tags || true
$env:MINVER_TAG_PREFIX="v"
$env:MINVER_AUTO_INCREMENT_LEVEL="Minor"
$env:MINVER_PRERELEASE_IDENTIFIER="preview"
echo "HYPERLIGHTWASM_VERSION=$(minver)"| Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
echo "HYPERLIGHTWASM_VERSION=$(minver)"
shell: pwsh
- name: Download Wasm Host
uses: actions/download-artifact@v4
with:
name: wasm-runtime-${{ matrix.config }}
path: ${{ env.PLATFORM }}/${{ matrix.config }}
- name: Download Wasm Modules
uses: actions/download-artifact@v4
with:
name: guest-modules
path: ${{ env.PLATFORM }}/${{ matrix.config }}
- name: Build rust wasm modules
run: just build-rust-wasm-examples ${{ matrix.config }}
shell: bash
- name: Download Benchmarks (Windows)
uses: actions/download-artifact@v4
with:
name: benchmarks_Windows_whp
path: benchmarks_Windows_whp
- name: Download Benchmarks (Linux hyperv)
uses: actions/download-artifact@v4
with:
name: benchmarks_Linux_hyperv
path: benchmarks_Linux_hyperv
- name: Download Benchmarks (Linux kvm)
uses: actions/download-artifact@v4
with:
name: benchmarks_Linux_kvm
path: benchmarks_Linux_kvm
- name: Archive benchmarks
run: |
tar -zcvf benchmarks_Windows_whp.tar.gz benchmarks_Windows_whp
tar -zcvf benchmarks_Linux_hyperv.tar.gz benchmarks_Linux_hyperv
tar -zcvf benchmarks_Linux_kvm.tar.gz benchmarks_Linux_kvm
- name: Install github-cli
run: |
$ProgressPreference = 'SilentlyContinue'
# check if gh cli is installed
$installed = [bool](Get-Command -ErrorAction Ignore -Type Application gh)
if ($installed) { Write-Host "gh cli already installed"; exit 0 }
# download and install gh cli
Invoke-WebRequest https://github.com/cli/cli/releases/download/v2.50.0/gh_2.50.0_windows_amd64.msi -OutFile gh.msi
msiexec.exe /i gh.msi /quiet /l log.txt | Out-Null
Write-Host "msiexec exited with code $LASTEXITCCODE"
if ($LASTEXITCODE -ne 0) { cat log.txt; exit 1 }
- name: Create pre-release
if: (!contains(github.ref, 'refs/heads/release/')) && matrix.config == 'debug'
run: |
echo "PWD: $PWD"
ls -alR
gh release delete dev-latest -y --cleanup-tag || true
gh release create dev-latest -t "Latest Development Build From Dev Branch" --latest=false -p \
${{ env.PLATFORM }}/${{ matrix.config }}/HelloWorld.wasm \
${{ env.PLATFORM }}/${{ matrix.config }}/RunWasm.wasm \
${{ env.PLATFORM }}/${{ matrix.config }}/HelloWorld.aot \
${{ env.PLATFORM }}/${{ matrix.config }}/wasm_runtime.* \
${{ env.PLATFORM }}/${{ matrix.config }}/rust_wasm_samples.aot \
${{ env.PLATFORM }}/${{ matrix.config }}/rust_wasm_samples.wasm \
benchmarks_Windows_whp.tar.gz \
benchmarks_Linux_hyperv.tar.gz \
benchmarks_Linux_kvm.tar.gz
env:
GH_TOKEN: ${{ github.token }}
shell: bash
- name: Create Release
if: contains(github.ref, 'refs/heads/release/') && matrix.config == 'release'
run: |
echo "PWD: $PWD"
ls -alR
gh release create v${{ env.HYPERLIGHTWASM_VERSION }} -t "Release v${{ env.HYPERLIGHTWASM_VERSION }}" --generate-notes \
${{ env.PLATFORM }}/${{ matrix.config }}/HelloWorld.wasm \
${{ env.PLATFORM }}/${{ matrix.config }}/RunWasm.wasm \
${{ env.PLATFORM }}/${{ matrix.config }}/HelloWorld.aot \
${{ env.PLATFORM }}/${{ matrix.config }}/RunWasm.aot \
${{ env.PLATFORM }}/${{ matrix.config }}/wasm_runtime.* \
${{ env.PLATFORM }}/${{ matrix.config }}/rust_wasm_samples.aot \
${{ env.PLATFORM }}/${{ matrix.config }}/rust_wasm_samples.wasm \
benchmarks_Windows_whp.tar.gz \
benchmarks_Linux_hyperv.tar.gz \
benchmarks_Linux_kvm.tar.gz
env:
GH_TOKEN: ${{ github.token }}
shell: bash