Skip to content

Build preview packages and publish them to nuget #12

Build preview packages and publish them to nuget

Build preview packages and publish them to nuget #12

name: Build a preview and release it to Nuget
on: workflow_dispatch
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Setup .NET SDK
uses: actions/setup-dotnet@v4
- name: Install Workload
run: dotnet workload install maui-windows android wasm-tools wasi-experimental # ois and maui-ios are not supported in ubuntu machines https://github.com/dotnet/maui/issues/15929
- name: Checkout
uses: actions/checkout@v4
- name: Install dependencies
run: dotnet restore
- name: Create build solution
run: dotnet slngen -c Release -o build.sln --launch false src\**\*.csproj
- name: define version suffix
run: echo "VERSIONSUFFIX=Preview-$(date +'%Y%m%d-%H%M')" >> $GITHUB_ENV
- name: Build
run: dotnet build build.sln -c Release --version-suffix ${{env.VERSIONSUFFIX}}
# - name: Test
# run: dotnet test -c Release --no-build
- name: Pack nugets
run: dotnet pack build.sln -c Release --no-build --output .
# - name: Push to NuGet
# run: dotnet nuget push "*.nupkg" --api-key ${{secrets.InteropTypes_PublishToNuget}} --source https://api.nuget.org/v3/index.json
- name: Push to NuGet
run: dotnet nuget push "InteropTypes.Tensors.*.nupkg" --api-key ${{secrets.InteropTypes_PublishToNuget}} --source https://api.nuget.org/v3/index.json
- name: unlist
run: dotnet nuget delete "InteropTypes.Tensors.1.0.0-${{env.VERSIONSUFFIX}}" --api-key ${{secrets.InteropTypes_PublishToNuget}} --source https://api.nuget.org/v3/index.json