Build NuGet package #13
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: "build" | |
run-name: Build NuGet package | |
on: | |
push: | |
branches: ["main"] | |
paths: | |
- "src/**" | |
pull_request: | |
branches: ["main"] | |
paths: | |
- "src/**" | |
- ".github/workflows/build-package.yml" | |
jobs: | |
package: | |
name: package | |
runs-on: ubuntu-latest | |
outputs: | |
version: "${{ steps.gitversion.outputs.nuGetVersion }}" | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Install GitVersion | |
uses: gittools/actions/gitversion/setup@v0 | |
with: | |
versionSpec: "5.x" | |
preferLatestVersion: true | |
- name: Determine version | |
id: gitversion | |
uses: gittools/actions/gitversion/execute@v0 | |
with: | |
updateAssemblyInfo: true | |
useConfigFile: true | |
configFilePath: gitversion.yml | |
- name: Install .NET SDK | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: "7.x" | |
dotnet-quality: "ga" | |
- name: Build library | |
run: > | |
dotnet build src/Indicators.csproj | |
--configuration Release | |
--property:Version=${{ steps.gitversion.outputs.nuGetVersion }} | |
--property:ContinuousIntegrationBuild=true | |
-warnAsError | |
- name: Pack for NuGet | |
run: > | |
dotnet pack src/Indicators.csproj | |
--configuration Release | |
--no-build | |
--include-symbols | |
--output NuGet | |
-p:PackageVersion=${{ steps.gitversion.outputs.nuGetVersion }} | |
- name: Save NuGet package | |
uses: actions/upload-artifact@v3 | |
with: | |
name: packages | |
path: NuGet | |
- name: Show version | |
run: | | |
{ | |
echo "### Identified semantic version" | |
echo "| Variable | Value |" | |
echo "| --------------- | ----------------------------------------------- |" | |
echo "| Major | ${{ steps.gitversion.outputs.major }} |" | |
echo "| Minor | ${{ steps.gitversion.outputs.minor }} |" | |
echo "| Patch | ${{ steps.gitversion.outputs.patch }} |" | |
echo "| PreReleaseTag | ${{ steps.gitversion.outputs.preReleaseTag }} |" | |
echo "| MajorMinorPatch | ${{ steps.gitversion.outputs.majorMinorPatch }} |" | |
echo "| SemVer | ${{ steps.gitversion.outputs.semVer }} |" | |
echo "| NuGetVersion | ${{ steps.gitversion.outputs.nuGetVersion }} |" | |
} >> $GITHUB_STEP_SUMMARY |