Skip to content

Generate vendor.tar in release workflow #83

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 1, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 33 additions & 26 deletions .github/workflows/CreateRelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Create a Release
on:
workflow_dispatch:
push:
branches: [ release/**, dev ]
branches: [ release/**, main ]

permissions:
contents: write
Expand All @@ -15,14 +15,21 @@ jobs:
uses: ./.github/workflows/Benchmarks.yml

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' }}
needs: [ benchmarks ]
runs-on: windows-latest
strategy:
matrix:
config: [debug, release]
env:
PLATFORM: x64
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@v4
with:
fetch-depth: 0
Expand All @@ -31,6 +38,18 @@ jobs:
uses: hyperlight-dev/[email protected]
with:
rust-toolchain: "1.85.0"
- name: Verify vendor.tar
run: |
mv ./src/hyperlight_wasm/vendor.tar ./vendor.tar
just make-vendor-tar
if ! git diff --no-index ./vendor.tar ./src/hyperlight_wasm/vendor.tar; then
echo "vendor.tar is not up to date, please run 'just make-vendor-tar' and commit the changes"
exit 1
fi
shell: bash
- name: Package hyperlight-wasm crate
run: cargo package -p hyperlight-wasm
shell: bash
- name: Install minver_rs
run: |
cargo install minver_rs
Expand All @@ -44,18 +63,13 @@ jobs:
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 }}
path: ${{ env.PLATFORM }}/${{ env.CONFIG }}
- name: Build rust wasm modules
run: just build-rust-wasm-examples ${{ matrix.config }}
run: just build-rust-wasm-examples ${{ env.CONFIG }}
shell: bash
- name: Download Benchmarks (Windows)
uses: actions/download-artifact@v4
Expand Down Expand Up @@ -89,40 +103,33 @@ jobs:
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'
if: ${{ github.ref=='refs/heads/main' }}
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'
if: ${{ contains(github.ref, 'refs/heads/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
- name: Publish to crates.io
if: ${{ contains(github.ref, 'refs/heads/release/') }}
run: cargo publish hyperlight-wasm
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_PUBLISH_TOKEN }}
shell: bash
8 changes: 8 additions & 0 deletions .github/workflows/CreateReleaseBranch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,16 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: extractions/setup-just@v3
with:
just-version: "1.40"
- name: Create Release Branch
run: |
git checkout -b release/${GITHUB_REF_NAME}
just make-vendor-tar
sed '/vendor.tar/d' ./src/hyperlight_wasm/.gitignore
git add ./src/hyperlight_wasm/vendor.tar
git add ./src/hyperlight_wasm/.gitignore
git commit -m "Vendor dependencies for release ${GITHUB_REF_NAME}" -s -S
git push --set-upstream origin release/${GITHUB_REF_NAME}
shell: bash
3 changes: 2 additions & 1 deletion src/hyperlight_wasm/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
vendor.tar
vendor.tar
target
1 change: 1 addition & 0 deletions src/hyperlight_wasm_macro/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
target
Loading