Skip to content
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
48 changes: 31 additions & 17 deletions .github/workflows/CreateRelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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 \
Expand All @@ -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/') }}
8 changes: 8 additions & 0 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Loading