Skip to content

chore: Update GitVersion configuration to use 'master' branch instead… #4

chore: Update GitVersion configuration to use 'master' branch instead…

chore: Update GitVersion configuration to use 'master' branch instead… #4

Workflow file for this run

name: master
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install GitVersion
uses: gittools/actions/gitversion/[email protected]
with:
versionSpec: '6.x'
- name: Determine Version
id: version # step id used as reference for output values
uses: gittools/actions/gitversion/[email protected]
- name: Print GitVersion_MajorMinorPatch
run: echo "The GitVersion_MajorMinorPatch is ${{ env.GitVersion_MajorMinorPatch }}"
- name: Setup .NET SDK
uses: actions/setup-dotnet@v1
with:
dotnet-version: '8.0.x'
- name: Install dependencies
run: dotnet restore CronScheduler.sln
- name: Build
run: dotnet build CronScheduler.sln --configuration Release --no-restore /p:Version=${{ env.GitVersion_MajorMinorPatch }}
- name: Test
run: dotnet test
- name: Publish NuGet package
run: |
dotnet pack src/YourProject/YourProject.csproj --configuration Release --output ./nupkg /p:Version=${{ env.GitVersion_MajorMinorPatch }} /p:Version=${{ env.GitVersion_MajorMinorPatch }}
dotnet nuget push ./nupkg/*.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json --skip-duplicate