v2.17.1 #28
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish packages | |
on: | |
release: # on new releases | |
types: [created] | |
workflow_dispatch: # manual event | |
inputs: | |
ref: | |
description: 'The branch, tag or SHA to checkout' | |
required: true | |
default: 'master' | |
isSnapshot: | |
description: 'Is snapshot release? Set to false if this is an official release' | |
required: true | |
default: 'true' | |
jobs: | |
publish-nuget: | |
runs-on: ubuntu-24.04 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: "${{ github.event.inputs.ref }}" | |
fetch-depth: '0' # all | |
- name: Setup .NET Core 8.0 | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: '8.0.x' | |
- name: Setup gitversion | |
run: dotnet tool install --global GitVersion.Tool | |
- name: Calculate version | |
id: calc_version | |
run: | | |
GITVERSION=$(dotnet-gitversion /output json /showvariable FullSemVer) | |
echo "::set-output name=PROJECT_VERSION::$GITVERSION" | |
- name: Restore packages | |
run: dotnet restore DynamicExpresso.sln | |
- name: Build | |
run: dotnet build DynamicExpresso.sln --no-restore -c Release /p:Version=${{steps.calc_version.outputs.PROJECT_VERSION}} | |
- name: Test .net core 8.0 | |
run: dotnet test DynamicExpresso.sln --no-build --no-restore -c Release /p:Version=${{steps.calc_version.outputs.PROJECT_VERSION}} --verbosity normal -f net8.0 | |
- name: Setup nuget sources | |
run: dotnet nuget add source --name github "https://nuget.pkg.github.com/dynamicexpresso/index.json" | |
- name: Pack | |
run: dotnet pack DynamicExpresso.sln --no-build --no-restore -c Release /p:Version=${{steps.calc_version.outputs.PROJECT_VERSION}} -p:IncludeSymbols=true -p:SymbolPackageFormat=snupkg | |
- name: Publish to github | |
run: dotnet nuget push "src/DynamicExpresso.Core/bin/Release/DynamicExpresso.Core.${{steps.calc_version.outputs.PROJECT_VERSION}}.nupkg" --source "github" --api-key ${{ secrets.GITHUB_TOKEN }} | |
- name: Publish to nuget.org | |
if: ${{ github.event.inputs.isSnapshot != 'true' }} | |
run: dotnet nuget push "src/DynamicExpresso.Core/bin/Release/DynamicExpresso.Core.${{steps.calc_version.outputs.PROJECT_VERSION}}.nupkg" --source "nuget.org" --api-key ${{ secrets.NUGET_KEY }} |