ModuleInitializer class to help resolve assemblies before attributes #48
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: Publish | |
on: | |
release: | |
types: [published] | |
push: {} | |
pull_request: {} | |
env: | |
Configuration: Release | |
ProjectDir: src\SourceGenerator.Foundations\ | |
ProjectName: SourceGenerator.Foundations.csproj | |
SolutionPath: src\SourceGenerator.Foundations.sln | |
MSBUILDDISABLENODEREUSE: '1' # Stops MSBuild from locking MSBuild nuget package | |
jobs: | |
publish: | |
name: build, bundle & publish | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.head_ref }} # checkout the correct branch name | |
fetch-depth: 0 # fetch the whole repo history | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: 6.0.x | |
- name: Restore | |
run: dotnet tool restore | |
- name: GitVersion | |
run: dotnet gitversion /output buildserver | |
# Build Dependencies | |
- name: Build | SourceGenerator.Foundations.MSBuild | |
run: dotnet build src\SourceGenerator.Foundations.MSBuild\SourceGenerator.Foundations.MSBuild.csproj -p:Version=${{env.GitVersion_AssemblySemVer}} | |
# Build Main | |
- name: Build | SourceGenerator.Foundations\SourceGenerator.Foundations | |
run: dotnet build src\SourceGenerator.Foundations\SourceGenerator.Foundations.csproj -p:Version=${{env.GitVersion_AssemblySemVer}} -p:PackageVersion=${{env.GitVersion_SemVer}} | |
- name: Test | Solution | |
run: dotnet test ${{env.SolutionPath}} | |
- name: Pack | SourceGenerator.Foundations\SourceGenerator.Foundations | |
run: dotnet pack src\SourceGenerator.Foundations\SourceGenerator.Foundations.csproj -p:Version=${{env.GitVersion_AssemblySemVer}} -p:PackageVersion=${{env.GitVersion_FullSemVer}} | |
# -- Release Only -- | |
- name: Push NuGet | |
run: dotnet nuget push ${{env.ProjectDir}}bin\${{env.Configuration}}\*.nupkg --skip-duplicate --api-key ${{secrets.NUGET_API_KEY}} --source https://api.nuget.org/v3/index.json |