Skip to content

Commit 682ad20

Browse files
authored
release: v0.11.0 — first crates.io publish (#102)
* chore: bump version to 0.11.0 and add crates.io metadata Signed-off-by: danbugs <danilochiarlone@gmail.com> * docs: update pyhl install instructions for crates.io Signed-off-by: danbugs <danilochiarlone@gmail.com> * ci: add cargo publish workflow for crates.io releases Signed-off-by: danbugs <danilochiarlone@gmail.com> * ci: trigger publish on release, skip auth for dry runs - Trigger on release published event (creating a release in GitHub UI) - Keep workflow_dispatch for manual dry runs - Only authenticate with crates.io when actually publishing - Dry runs use cargo publish --dry-run without minting a token Signed-off-by: danbugs <danilochiarlone@gmail.com> * fix: rename crate to hyperlight-unikraft (matches crates.io reservation) Signed-off-by: danbugs <danilochiarlone@gmail.com> * fix: remove stale package rename in pptx-gen demo Signed-off-by: danbugs <danilochiarlone@gmail.com> --------- Signed-off-by: danbugs <danilochiarlone@gmail.com>
1 parent 1caba5c commit 682ad20

5 files changed

Lines changed: 81 additions & 9 deletions

File tree

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: Publish to crates.io
2+
3+
on:
4+
release:
5+
types: [published]
6+
workflow_dispatch:
7+
inputs:
8+
dry_run:
9+
description: "Run without actually publishing"
10+
type: boolean
11+
default: true
12+
13+
permissions:
14+
contents: read
15+
id-token: write
16+
17+
jobs:
18+
publish:
19+
runs-on: ubuntu-latest
20+
21+
steps:
22+
- uses: actions/checkout@v4
23+
with:
24+
fetch-depth: 0
25+
26+
- uses: dtolnay/rust-toolchain@stable
27+
28+
- name: Determine if dry run
29+
id: mode
30+
run: |
31+
if [ "${{ github.event_name }}" = "release" ]; then
32+
echo "dry_run=false" >> "$GITHUB_OUTPUT"
33+
else
34+
echo "dry_run=${{ inputs.dry_run }}" >> "$GITHUB_OUTPUT"
35+
fi
36+
37+
- name: Verify version matches tag
38+
if: ${{ steps.mode.outputs.dry_run == 'false' }}
39+
run: |
40+
TAG="${GITHUB_REF#refs/tags/v}"
41+
CARGO_VER=$(grep '^version' host/Cargo.toml | head -1 | sed 's/.*"\(.*\)"/\1/')
42+
if [ "$TAG" != "$CARGO_VER" ]; then
43+
echo "::error::Tag v$TAG does not match Cargo.toml version $CARGO_VER"
44+
exit 1
45+
fi
46+
47+
- name: Check crate not already published
48+
run: |
49+
CARGO_VER=$(grep '^version' host/Cargo.toml | head -1 | sed 's/.*"\(.*\)"/\1/')
50+
if curl -sf "https://crates.io/api/v1/crates/hyperlight-unikraft/$CARGO_VER" -H "User-Agent: hyperlight-unikraft" | jq -e .version > /dev/null 2>&1; then
51+
echo "::warning::hyperlight-unikraft@$CARGO_VER already published"
52+
echo "ALREADY_PUBLISHED=true" >> "$GITHUB_ENV"
53+
fi
54+
55+
- name: Dry run (no auth needed)
56+
if: ${{ steps.mode.outputs.dry_run == 'true' && env.ALREADY_PUBLISHED != 'true' }}
57+
run: cargo publish --manifest-path host/Cargo.toml --dry-run
58+
59+
- name: Authenticate with crates.io
60+
if: ${{ steps.mode.outputs.dry_run == 'false' && env.ALREADY_PUBLISHED != 'true' }}
61+
uses: rust-lang/crates-io-auth-action@v1
62+
id: crates-io-auth
63+
64+
- name: Publish hyperlight-unikraft
65+
if: ${{ steps.mode.outputs.dry_run == 'false' && env.ALREADY_PUBLISHED != 'true' }}
66+
run: cargo publish --manifest-path host/Cargo.toml
67+
env:
68+
CARGO_REGISTRY_TOKEN: ${{ steps.crates-io-auth.outputs.token }}

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,15 +117,14 @@ pillow/lxml/cryptography/dateutil/dotenv preloaded) behind a simple
117117
`setup` / `run` workflow:
118118

119119
```bash
120+
# Install pyhl from crates.io
121+
cargo install hyperlight-unikraft --bin pyhl
122+
120123
# One-time: build the driver image (kernel + CPIO)
121124
cd examples/python-agent-driver
122125
just rootfs && just build
123126
cd ../..
124127

125-
# Install pyhl
126-
cargo install --git https://github.com/hyperlight-dev/hyperlight-unikraft \
127-
hyperlight-unikraft-host --bin pyhl
128-
129128
# Point pyhl at the image you just built — creates ./.pyhl/ in cwd
130129
pyhl setup --from examples/python-agent-driver
131130

demos/pptx-gen/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ description = "PowerPoint generator using Hyperlight-Unikraft sandboxed Python e
66

77
[dependencies]
88
# Hyperlight-Unikraft library
9-
hyperlight-unikraft = { path = "../../host", package = "hyperlight-unikraft-host" }
9+
hyperlight-unikraft = { path = "../../host" }
1010

1111
# OpenAI API client
1212
async-openai = "0.25"

host/Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

host/Cargo.toml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
[package]
2-
name = "hyperlight-unikraft-host"
3-
version = "0.10.0"
2+
name = "hyperlight-unikraft"
3+
version = "0.11.0"
44
edition = "2021"
55
description = "Embedded Hyperlight host for running Unikraft unikernels"
66
license = "MIT OR Apache-2.0"
7+
repository = "https://github.com/hyperlight-dev/hyperlight-unikraft"
8+
homepage = "https://github.com/hyperlight-dev/hyperlight-unikraft"
9+
keywords = ["hyperlight", "unikraft", "unikernel", "microvm", "sandbox"]
10+
categories = ["virtualization"]
11+
readme = "../README.md"
712

813
[lib]
914
name = "hyperlight_unikraft"

0 commit comments

Comments
 (0)