Feat/update (#54) #3
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: 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/setup@v3.0.0 | |
with: | |
versionSpec: '6.x' | |
- name: Determine Version | |
id: version # step id used as reference for output values | |
uses: gittools/actions/gitversion/execute@v3.0.0 | |
- name: Print GitVersion_SemVer | |
run: echo "The GitVersion_SemVer is ${{ env.GitVersion_SemVer }}" | |
- 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_SemVer }} | |
- name: Test | |
run: dotnet test | |
- name: Publish NuGet package | |
run: | | |
dotnet pack src/YourProject/YourProject.csproj --configuration Release --output ./nupkg /p:Version=${{ env.GitVersion_SemVer }} /p:Version=${{ env.GitVersion_SemVer }} | |
dotnet nuget push ./nupkg/*.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json --skip-duplicate |