-
Notifications
You must be signed in to change notification settings - Fork 36
132 lines (126 loc) · 4.46 KB
/
CreateRelease.yml
File metadata and controls
132 lines (126 loc) · 4.46 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
129
130
131
132
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: Create a Release
on:
workflow_dispatch:
push:
branches: [ release/**, main ]
permissions:
contents: write
packages: write
id-token: write # Required for crates.io trusted publishing
jobs:
benchmarks:
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: ubuntu-latest
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@v5
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.8.0
with:
rust-toolchain: "1.89"
- name: Package hyperlight-wasm crate
if: ${{ contains(github.ref, 'refs/heads/release/') }}
run: cargo package -p hyperlight-wasm
shell: bash
- name: Set HYPERLIGHTWASM_VERSION
run: |
git fetch --tags
version=$(echo "${{ github.ref }}" | sed -E 's#refs/heads/release/v##')
echo "HYPERLIGHTWASM_VERSION=$version" >> $GITHUB_ENV
echo "HYPERLIGHTWASM_VERSION=$version"
if: ${{ contains(github.ref, 'refs/heads/release/') }}
shell: bash
- name: Download Wasm Modules
uses: actions/download-artifact@v5
with:
name: guest-modules
path: ${{ env.PLATFORM }}/${{ env.CONFIG }}
- name: Build rust wasm modules
run: just build-rust-wasm-examples ${{ env.CONFIG }}
shell: bash
- name: Download all benchmarks
uses: actions/download-artifact@v5
with:
pattern: benchmarks_*
- name: Archive benchmarks
shell: bash
run: |
for BENCHMARK in benchmarks_*; do
tar -zcvf $BENCHMARK.tar.gz $BENCHMARK
done
- name: Create pre-release
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 \
benchmarks_*.tar.gz
env:
GH_TOKEN: ${{ github.token }}
shell: bash
- name: Create 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 \
benchmarks_*.tar.gz
env:
GH_TOKEN: ${{ github.token }}
shell: bash
- name: Authenticate with crates.io
if: ${{ contains(github.ref, 'refs/heads/release/') }}
uses: rust-lang/crates-io-auth-action@v1
id: crates-io-auth
- name: Install cargo-overlay-registry
if: ${{ contains(github.ref, 'refs/heads/release/') }}
run: cargo install cargo-overlay-registry
shell: bash
- name: Publish dry-run
if: ${{ contains(github.ref, 'refs/heads/release/') }}
run: |
set -euxo pipefail
rm -Rf ./target/package/tmp-registry
cargo overlay-registry \
-r crates-io \
-r local=./target/package/tmp-registry \
-- \
cargo +1.92 publish --dry-run \
-p hyperlight-wasm-aot \
-p hyperlight-wasm-macro \
-p hyperlight-wasm-runtime \
-p hyperlight-wasm
shell: bash
- name: Publish to crates.io
if: ${{ contains(github.ref, 'refs/heads/release/') }}
run: |
set -euxo pipefail
rm -Rf ./target/package/tmp-registry
cargo overlay-registry \
-r crates-io \
-r local=./target/package/tmp-registry \
-- \
cargo +1.92 publish \
-p hyperlight-wasm-aot \
-p hyperlight-wasm-macro \
-p hyperlight-wasm-runtime \
-p hyperlight-wasm
env:
CARGO_REGISTRY_TOKEN: ${{ steps.crates-io-auth.outputs.token }}
shell: bash