Skip to content

Commit

Permalink
Bump Wasmtime version to 19.0.1. (#303)
Browse files Browse the repository at this point in the history
* Bump Wasmtime version to 19.0.1.

* Add a publish action for new tags.

* Add release information to README.md.

Closes #5.
  • Loading branch information
peterhuene authored Apr 7, 2024
1 parent ef92322 commit df88687
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 6 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# The purpose of this workflow is to publish the packages to NuGet
# whenever a tag is created.

name: "Publish to NuGet"

on:
push:
tags:
- 'v*'

jobs:
publish:
name: "Publish NuGet Package"
if: github.repository == 'bytecodealliance/wasmtime-dotnet'
runs-on: ubuntu-latest
env:
DevBuild: 'false'
steps:
- uses: actions/checkout@v3
- name: Create NuGet package
run: |
cd src
dotnet pack -c Release /p:Packing=true
- name: Publish NuGet Package
run: |
cd src/bin/Release
dotnet nuget push Wasmtime.${GITHUB_REF_NAME:1}.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project>
<PropertyGroup>
<DevBuild Condition="'$(DevBuild)'==''">true</DevBuild>
<WasmtimeVersion Condition="'$(WasmtimeVersion)'==''">19.0.0</WasmtimeVersion>
<WasmtimeVersion Condition="'$(WasmtimeVersion)'==''">19.0.1</WasmtimeVersion>
<WasmtimeDotnetVersion Condition="'$(WasmtimeDotnetVersion)'==''"></WasmtimeDotnetVersion>
<WasmtimePackageVersion Condition="'$(DevBuild)'=='true'">$(WasmtimeVersion)$(WasmtimeDotnetVersion)-dev</WasmtimePackageVersion>
<WasmtimePackageVersion Condition="'$(WasmtimePackageVersion)'==''">$(WasmtimeVersion)$(WasmtimeDotnetVersion)</WasmtimePackageVersion>
Expand Down
43 changes: 39 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ $ dotnet add package wasmtime

## Introduction

For this introduction, we'll be using a simple WebAssembly module that imports a `hello` function and exports a `run` function:
For this introduction, we'll be using a simple WebAssembly module that imports
a `hello` function and exports a `run` function:

```wat
(module
Expand Down Expand Up @@ -83,7 +84,8 @@ var run = instance.GetAction("run")!;
run();
```

An `Engine` is created and then a WebAssembly module is loaded from a string in WebAssembly text format.
An `Engine` is created and then a WebAssembly module is loaded from a string in
WebAssembly text format.

A `Linker` defines a function called `hello` that simply prints a hello message.

Expand All @@ -107,7 +109,8 @@ Use `dotnet` to build the repository:
$ dotnet build Wasmtime.sln
```

This will download the latest development snapshot of Wasmtime for your platform.
This will download the latest development snapshot of Wasmtime for your
platform.

### Testing

Expand All @@ -128,4 +131,36 @@ $ dotnet pack Wasmtime.sln -c Release /p:Packing=true

This will create a `.nupkg` file in `src/bin/Release`.

By default, local builds will use a `-dev` suffix for the package to differentiate between official packages and development packages.
By default, local builds will use a `-dev` suffix for the package to
differentiate between official packages and development packages.

### Updating Wasmtime for a release

To update the Wasmtime library used for a new release, change `WasmtimeVersion`
in `Directory.Build.props`:

```xml
<WasmtimeVersion Condition="'$(WasmtimeVersion)'==''">$VERSION</WasmtimeVersion>
```

Additionally, edit `Wasmtime.csproj` to change the `PackageReleaseNotes` to the
new version:

```xml
<PackageReleaseNotes>Update Wasmtime to $VERSION.</PackageReleaseNotes>
```

### Publishing the Wasmtime .NET NuGet package

GitHub actions is used to automatically publish a package to NuGet when a tag
is pushed to the repository.

To publish a new release, create a release in GitHub and add the relevant
release notes.

Use a tag of the format `v$VERSION` where `$VERSION` matches the Wasmtime
version used by the .NET package; ensure the tagged commit matches the last
commit to make for the release.

When the release is published on GitHub, an action should automatically start
to build and publish the package to NuGet.
2 changes: 1 addition & 1 deletion src/Wasmtime.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<RepositoryUrl>https://github.com/bytecodealliance/wasmtime-dotnet</RepositoryUrl>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<PackageReleaseNotes>Update Wasmtime to 19.0.0.</PackageReleaseNotes>
<PackageReleaseNotes>Update Wasmtime to 19.0.1.</PackageReleaseNotes>
<Summary>A .NET API for Wasmtime, a standalone WebAssembly runtime</Summary>
<PackageTags>webassembly, .net, wasm, wasmtime</PackageTags>
<Title>Wasmtime</Title>
Expand Down

0 comments on commit df88687

Please sign in to comment.