|
| 1 | +# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json |
| 2 | + |
| 3 | +name: Create a Release |
| 4 | + |
| 5 | +on: |
| 6 | + workflow_dispatch: |
| 7 | + push: |
| 8 | + branches: [dev] |
| 9 | + |
| 10 | +permissions: |
| 11 | + id-token: write |
| 12 | + contents: write # needed to create a release |
| 13 | + |
| 14 | +jobs: |
| 15 | + build: |
| 16 | + uses: ./.github/workflows/dep_build.yml |
| 17 | + secrets: inherit |
| 18 | + with: |
| 19 | + environment: release |
| 20 | + benchmarks: |
| 21 | + uses: ./.github/workflows/dep_benchmarks.yml |
| 22 | + secrets: inherit |
| 23 | + with: |
| 24 | + download-benchmarks: true |
| 25 | + upload-benchmarks: true |
| 26 | + environment: release |
| 27 | + |
| 28 | + publish-hyperlight-js-packages-and-create-release: |
| 29 | + needs: [build, benchmarks] |
| 30 | + environment: release |
| 31 | + runs-on: [self-hosted, Linux, X64, "1ES.Pool=hld-kvm-amd"] |
| 32 | + if: ${{ contains(github.ref, 'refs/heads/release/') }} |
| 33 | + |
| 34 | + steps: |
| 35 | + - uses: actions/checkout@v6 |
| 36 | + with: |
| 37 | + fetch-depth: 0 |
| 38 | + fetch-tags: true |
| 39 | + |
| 40 | + # Ensures just is installed using setup wokflow to ensure just version consistency |
| 41 | + - name: Hyperlight setup |
| 42 | + uses: hyperlight-dev/ci-setup-workflow@v1.8.0 |
| 43 | + with: |
| 44 | + rust-toolchain: "1.89" |
| 45 | + |
| 46 | + - name: Set crate versions |
| 47 | + run: | |
| 48 | + git fetch --tags || true |
| 49 | + version=$(echo "${{ github.ref }}" | sed -E 's#refs/heads/release/v##') |
| 50 | + echo "Setting version to 'v$version'" |
| 51 | + echo "HYPERLIGHT_JS_VERSION=v$version" >> $GITHUB_ENV |
| 52 | +
|
| 53 | + - name: Publish hyperlight-js |
| 54 | + run: | |
| 55 | + cargo publish -p hyperlight-js-runtime |
| 56 | + cargo publish -p hyperlight-js |
| 57 | +
|
| 58 | + - name: Download benchmarks (Windows) |
| 59 | + uses: actions/download-artifact@v7 |
| 60 | + with: |
| 61 | + name: benchmarks_Windows_whp |
| 62 | + path: benchmarks_Windows_whp |
| 63 | + |
| 64 | + - name: Download benchmarks (Linux kvm) |
| 65 | + uses: actions/download-artifact@v7 |
| 66 | + with: |
| 67 | + name: benchmarks_Linux_kvm |
| 68 | + path: benchmarks_Linux_kvm |
| 69 | + |
| 70 | + - name: Download benchmarks (Linux hyperv3) |
| 71 | + uses: actions/download-artifact@v7 |
| 72 | + with: |
| 73 | + name: benchmarks_Linux_hyperv3 |
| 74 | + path: benchmarks_Linux_hyperv3 |
| 75 | + |
| 76 | + - name: Archive benchmarks |
| 77 | + run: | |
| 78 | + tar -zcvf benchmarks_Windows_whp.tar.gz benchmarks_Windows_whp |
| 79 | + tar -zcvf benchmarks_Linux_kvm.tar.gz benchmarks_Linux_kvm |
| 80 | + tar -zcvf benchmarks_Linux_hyperv3.tar.gz benchmarks_Linux_hyperv3 |
| 81 | +
|
| 82 | + - name: Create GH Release |
| 83 | + run: | |
| 84 | + gh release create ${{ env.HYPERLIGHT_JS_VERSION }} \ |
| 85 | + --generate-notes \ |
| 86 | + benchmarks_Windows_whp.tar.gz \ |
| 87 | + benchmarks_Linux_kvm.tar.gz \ |
| 88 | + benchmarks_Linux_hyperv3.tar.gz |
| 89 | + env: |
| 90 | + GH_TOKEN: ${{ github.token }} |
0 commit comments