From 276aecfb2bf4f9458c6d11a43da65803e160bc2e Mon Sep 17 00:00:00 2001 From: Jorge Prendes Date: Mon, 18 May 2026 11:36:56 +0100 Subject: [PATCH 1/2] allow dry-run of npm publishing Signed-off-by: Jorge Prendes --- .github/workflows/CreateRelease.yml | 48 +++++++++++++++++++---------- 1 file changed, 31 insertions(+), 17 deletions(-) diff --git a/.github/workflows/CreateRelease.yml b/.github/workflows/CreateRelease.yml index 4fac7b0..1cda2de 100644 --- a/.github/workflows/CreateRelease.yml +++ b/.github/workflows/CreateRelease.yml @@ -24,14 +24,38 @@ jobs: download-benchmarks: true upload-benchmarks: true environment: release + + set-version: + runs-on: ubuntu-latest + outputs: + version: ${{ steps.set-version.outputs.version }} + + steps: + - uses: actions/checkout@v6 + with: + fetch-depth: 0 + fetch-tags: true + + - name: Set version + id: set-version + shell: bash + run: | + git fetch --tags || true + # Extract the version number from the branch name, which is expected to be in the format 'release/vX.Y.Z' + # if not, default to '0.0.0' to avoid errors in subsequent steps + if [[ "${GITHUB_REF}" =~ refs/heads/release/v([0-9]+\.[0-9]+\.[0-9]+) ]]; then + version="${BASH_REMATCH[1]}" + else + version="0.0.0" + fi + echo "Setting version to 'v$version'" + echo "version=$version" >> $GITHUB_OUTPUT publish-hyperlight-js-packages-and-create-release: - needs: [build, benchmarks] + needs: [build, benchmarks, set-version] environment: release runs-on: [self-hosted, Linux, X64, "1ES.Pool=hld-kvm-amd", "JobId=publish-hyperlight-js-${{ github.run_id }}-${{ github.run_number }}-${{ github.run_attempt }}"] if: ${{ contains(github.ref, 'refs/heads/release/') }} - outputs: - version: ${{ steps.set-version.outputs.version }} steps: - uses: actions/checkout@v6 @@ -50,15 +74,6 @@ jobs: uses: rust-lang/crates-io-auth-action@v1 id: crates-io-auth - - name: Set crate versions - id: set-version - run: | - git fetch --tags || true - version=$(echo "${{ github.ref }}" | sed -E 's#refs/heads/release/v##') - echo "Setting version to 'v$version'" - echo "HYPERLIGHT_JS_VERSION=v$version" >> $GITHUB_ENV - echo "version=$version" >> $GITHUB_OUTPUT - - name: Publish hyperlight-js run: | cargo publish -p hyperlight-js-runtime @@ -92,7 +107,7 @@ jobs: - name: Create GH Release run: | - gh release create ${{ env.HYPERLIGHT_JS_VERSION }} \ + gh release create ${{ needs.set-version.outputs.version }} \ --generate-notes \ benchmarks_Windows_whp.tar.gz \ benchmarks_Linux_kvm.tar.gz \ @@ -101,9 +116,8 @@ jobs: GH_TOKEN: ${{ github.token }} publish-npm-packages: - needs: [publish-hyperlight-js-packages-and-create-release] - if: ${{ contains(github.ref, 'refs/heads/release/') }} + needs: [set-version] uses: ./.github/workflows/npm-publish.yml with: - version: ${{ needs.publish-hyperlight-js-packages-and-create-release.outputs.version }} - dry-run: false + version: ${{ needs.set-version.outputs.version }} + dry-run: ${{ !contains(github.ref, 'refs/heads/release/') }} From 7659475a3807ce290e167f1b700aa8575a8c2fed Mon Sep 17 00:00:00 2001 From: Jorge Prendes Date: Mon, 18 May 2026 16:34:41 +0100 Subject: [PATCH 2/2] enable kvm hypervisor in npm publish workflow Signed-off-by: Jorge Prendes --- .github/workflows/npm-publish.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml index 248ee31..f0a4006 100644 --- a/.github/workflows/npm-publish.yml +++ b/.github/workflows/npm-publish.yml @@ -124,6 +124,14 @@ jobs: steps: - uses: actions/checkout@v6 + - name: Enable KVM + run: | + # This is required for the Validate packages. + sudo modprobe kvm || true + sudo modprobe kvm_intel || true + sudo modprobe kvm_amd || true + sudo chmod a+rwx /dev/kvm + - name: Setup Node.js uses: actions/setup-node@v6 with: