Skip to content

Update src/SourceFlow/SourceFlow.csproj #3

Update src/SourceFlow/SourceFlow.csproj

Update src/SourceFlow/SourceFlow.csproj #3

Workflow file for this run

name: pre-release-ci
on:
push:
branches:
- pre-release/**
- pre-release
jobs:
Build-Test-Publish:
runs-on: ubuntu-latest
env:
working-directory: ${{ github.workspace }}
github-token: '${{ secrets.GH_Packages }}'
nuget-token: '${{ secrets.NUGET_API_KEY }}'
steps:
- name: Step-01 Install GitVersion
uses: gittools/actions/gitversion/[email protected]
with:
versionSpec: 5.x
- name: Step-02 Check out Code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Step-03 Calculate Version
id: gitversion
uses: gittools/actions/gitversion/[email protected]
with:
useConfigFile: true
- name: Step-04 Display Version Info
run: |
echo "NuGetVersion: ${{ steps.gitversion.outputs.NuGetVersion }}"
echo "FullSemVer: ${{ steps.gitversion.outputs.FullSemVer }}"
echo "BranchName: ${{ steps.gitversion.outputs.BranchName }}"
- name: Step-05 Install .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 9.0.x
- name: Step-06 Restore dependencies
run: dotnet restore
working-directory: '${{ env.working-directory }}'
- name: Step-07 Build Version (Alpha)
run: dotnet build --configuration Release --no-restore -p:PackageVersion=${{ steps.gitversion.outputs.NuGetVersion }}
working-directory: '${{ env.working-directory }}'
- name: Step-08 Test Solution
run: dotnet test --configuration Release --no-build --no-restore --verbosity normal
working-directory: '${{ env.working-directory }}'
- name: Step-09 Create NuGet Package
run: dotnet pack --configuration Release --no-build --output ./packages -p:PackageVersion=${{ steps.gitversion.outputs.NuGetVersion }}
working-directory: '${{ env.working-directory }}'
- name: Step-10 Publish to Github Packages
run: |
dotnet tool install gpr --global
find ./packages -name "*.nupkg" -print -exec gpr push -k ${{ env.github-token }} {} \;
working-directory: '${{ env.working-directory }}'
- name: Step-11 Publish to NuGet.org (for release pre-releases)
if: ${{ env.nuget-token != '' && contains(github.ref, 'pre-release/v') }}
run: |
find ./packages -name "*.nupkg" -print -exec dotnet nuget push {} --skip-duplicate --api-key ${{ env.nuget-token }} --source https://api.nuget.org/v3/index.json \;
working-directory: '${{ env.working-directory }}'