Skip to content

Integrate GitVersion for deterministic versioning (#55) #97

Integrate GitVersion for deterministic versioning (#55)

Integrate GitVersion for deterministic versioning (#55) #97

Workflow file for this run

name: .NET
on:
push:
branches: [ "master" ]
tags: [ "*" ]
pull_request:
branches: [ "master" ]
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
- uses: gittools/actions/gitversion/setup@v3
- id: gitversion
uses: gittools/actions/gitversion/execute@v3
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore --configuration Release
- name: Test
run: dotnet test --no-build --verbosity normal --configuration Release
- name: Pack
run: >
dotnet pack MakeInterface.Generator/MakeInterface.Generator.csproj
--no-build -c Release
/p:PackageVersion=${{ steps.gitversion.outputs.nuGetVersionV2 }}
-o ./artifacts
- name: Publish prerelease to GitHub Packages
if: github.event_name == 'push' && github.ref_type == 'branch'
run: >
dotnet nuget push
./artifacts/MakeInterface.Generator.${{ steps.gitversion.outputs.nuGetVersionV2 }}.nupkg
--source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json"
--api-key ${{ secrets.GITHUB_TOKEN }} --skip-duplicate
- name: Publish release to NuGet.org
if: github.ref_type == 'tag'
run: >
dotnet nuget push
./artifacts/MakeInterface.Generator.${{ steps.gitversion.outputs.nuGetVersionV2 }}.nupkg
--source https://api.nuget.org/v3/index.json
--api-key ${{ secrets.NUGET_API_KEY }} --skip-duplicate