diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json new file mode 100644 index 0000000..95adf14 --- /dev/null +++ b/.config/dotnet-tools.json @@ -0,0 +1,12 @@ +{ + "version": 1, + "isRoot": true, + "tools": { + "gitversion.tool": { + "version": "5.12.0", + "commands": [ + "dotnet-gitversion" + ] + } + } +} \ No newline at end of file diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 6f19a9f..145e832 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -12,9 +12,7 @@ on: jobs: build: - runs-on: windows-latest - steps: - uses: actions/checkout@v3 with: diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 7044874..e16c264 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -6,7 +6,10 @@ on: tags: - 'v[0-9]+.[0-9]+.[0-9]+' env: - SOLUTION_PATH: ./src/SourceGenerator.Foundations.sln + Configuration: Release + ProjectDir: src\SourceGenerator.Foundations\ + ProjectName: SourceGenerator.Foundations.csproj + SolutionPath: src\SourceGenerator.Foundations.sln jobs: publish: name: build, bundle & publish @@ -21,33 +24,9 @@ jobs: uses: actions/setup-dotnet@v3 with: dotnet-version: 6.0.x - # Restore - - name: Restore dependencies - run: dotnet restore $env:SOLUTION_PATH - # Build - - name: Build - run: dotnet build $env:SOLUTION_PATH --no-restore - # Test - - name: Test - run: dotnet test $env:SOLUTION_PATH --no-build --verbosity normal - # Publish - - name: publish on version change - id: publish_nuget - uses: brandedoutcast/publish-nuget@v2 - with: - # Filepath of the project to be packaged, relative to root of repository - PROJECT_FILE_PATH: $env:PROJECT_PATH - # Platform target to compile (default is empty/AnyCPU) - BUILD_PLATFORM: x64 - # NuGet package id, used for version detection & defaults to project name - PACKAGE_NAME: SourceGenerator.Foundations - # Flag to toggle git tagging, enabled by default - TAG_COMMIT: true - # Format of the git tag, [*] gets replaced with actual version - TAG_FORMAT: '*' - # API key to authenticate with NuGet server - NUGET_KEY: ${{secrets.NUGET_API_KEY}} - # NuGet server uri hosting the packages, defaults to https://api.nuget.org - NUGET_SOURCE: https://api.nuget.org - # Flag to toggle pushing symbols along with nuget package to the server, disabled by default - INCLUDE_SYMBOLS: true + - run: dotnet tool restore + - run: dotnet gitversion /output buildserver + - run: dotnet build ${{env.SolutionPath}} -t:build -p:Version=${{env.GitVersion_AssemblySemVer}} + - run: dotnet test ${{env.SolutionPath}} + - run: dotnet build ${{env.SolutionPath}} -t:pack -p:PackageVersion=${{env.GitVersion_SemVer}} + - run: dotnet nuget push ${{env.ProjectDir}}${{env.Configuration}}\*.nupkg --skip-duplicate --api-key ${{secrets.NUGET_API_KEY}} --source https://api.nuget.org/v3/index.json diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 5de535a..eae1be3 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -1,6 +1,3 @@  - - 1.2.1 - \ No newline at end of file diff --git a/src/SourceGenerator.Foundations.Contracts/SourceGenerator.Foundations.Contracts.csproj b/src/SourceGenerator.Foundations.Contracts/SourceGenerator.Foundations.Contracts.csproj index a490346..592926f 100644 --- a/src/SourceGenerator.Foundations.Contracts/SourceGenerator.Foundations.Contracts.csproj +++ b/src/SourceGenerator.Foundations.Contracts/SourceGenerator.Foundations.Contracts.csproj @@ -6,6 +6,7 @@ netstandard2.0 + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/SourceGenerator.Foundations/SourceGenerator.Foundations.csproj b/src/SourceGenerator.Foundations/SourceGenerator.Foundations.csproj index 7314f14..f6a1d9d 100644 --- a/src/SourceGenerator.Foundations/SourceGenerator.Foundations.csproj +++ b/src/SourceGenerator.Foundations/SourceGenerator.Foundations.csproj @@ -6,7 +6,6 @@ true false true - true false Source Generator Foundations Byron Mayne