From df88687a7f614c635361533c4741a736ac904326 Mon Sep 17 00:00:00 2001 From: Peter Huene Date: Sun, 7 Apr 2024 12:26:17 -0700 Subject: [PATCH] Bump Wasmtime version to 19.0.1. (#303) * Bump Wasmtime version to 19.0.1. * Add a publish action for new tags. * Add release information to README.md. Closes #5. --- .github/workflows/publish.yml | 27 ++++++++++++++++++++++ Directory.Build.props | 2 +- README.md | 43 +++++++++++++++++++++++++++++++---- src/Wasmtime.csproj | 2 +- 4 files changed, 68 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..8afaf80 --- /dev/null +++ b/.github/workflows/publish.yml @@ -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 diff --git a/Directory.Build.props b/Directory.Build.props index 3a2bedc..a3b3054 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,7 +1,7 @@ true - 19.0.0 + 19.0.1 $(WasmtimeVersion)$(WasmtimeDotnetVersion)-dev $(WasmtimeVersion)$(WasmtimeDotnetVersion) diff --git a/README.md b/README.md index 7019fb4..746c85c 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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. @@ -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 @@ -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 +$VERSION +``` + +Additionally, edit `Wasmtime.csproj` to change the `PackageReleaseNotes` to the +new version: + +```xml +Update Wasmtime to $VERSION. +``` + +### 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. diff --git a/src/Wasmtime.csproj b/src/Wasmtime.csproj index 30e545d..e9eecc5 100644 --- a/src/Wasmtime.csproj +++ b/src/Wasmtime.csproj @@ -20,7 +20,7 @@ https://github.com/bytecodealliance/wasmtime-dotnet true true - Update Wasmtime to 19.0.0. + Update Wasmtime to 19.0.1. A .NET API for Wasmtime, a standalone WebAssembly runtime webassembly, .net, wasm, wasmtime Wasmtime