Skip to content

Commit

Permalink
feat(ci): publish nuget package automatically (#19)
Browse files Browse the repository at this point in the history
- use MinVer for versioning based on git tags
 - trigger release action when a tag is pushed with `v*` prefix
  • Loading branch information
mhmd-azeez authored Oct 9, 2023
1 parent 7ed7048 commit 4c250ac
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
18 changes: 10 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
on:
workflow_dispatch:
push:
tags:
- 'v*'

name: Release .NET SDK

Expand All @@ -10,20 +12,20 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install extism shared library
shell: bash
run: |
mkdir -p /home/runner/.local/bin/
export PATH="/home/runner/.local/bin/:$PATH"
curl https://raw.githubusercontent.com/extism/cli/main/install.sh | sh
extism --sudo --prefix /usr/local install

- name: Install libextism
if: runner.os != 'Windows'
uses: ./.github/actions/libextism

- name: Setup .NET Core SDK
uses: actions/setup-dotnet@v3.0.3
with:
dotnet-version: 7.x

- name: Test .NET Sdk
run: |
make test
- name: Publish .NET Sdk
env:
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
Expand Down
6 changes: 5 additions & 1 deletion src/Extism.Sdk/Extism.Sdk.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
<Nullable>enable</Nullable>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
<LangVersion>11</LangVersion>
<MinVerTagPrefix>v</MinVerTagPrefix>
</PropertyGroup>

<PropertyGroup>
<PackageId>Extism.Sdk</PackageId>
<Version>0.7.0</Version>
<Authors>Extism Contributors</Authors>
<Description>Extism SDK that allows hosting Extism plugins in .NET apps.</Description>
<Tags>extism, wasm, plugin</Tags>
Expand All @@ -23,6 +23,10 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="MinVer" Version="4.3.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="6.0.0" />
<PackageReference Include="System.Text.Json" Version="7.0.3" />
</ItemGroup>
Expand Down

0 comments on commit 4c250ac

Please sign in to comment.