From 7fbf301bafc5f983a5906e6d92185289cc1219ac Mon Sep 17 00:00:00 2001 From: Byron Mayne Date: Mon, 6 Nov 2023 20:06:49 -0500 Subject: [PATCH] Renamed the publish to publish_release This should also push to nuget whenever a release is created --- .../{publish.yml => publish_release.yml} | 26 ++++++++++--------- 1 file changed, 14 insertions(+), 12 deletions(-) rename .github/workflows/{publish.yml => publish_release.yml} (63%) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish_release.yml similarity index 63% rename from .github/workflows/publish.yml rename to .github/workflows/publish_release.yml index d48a9e0..8f263a5 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish_release.yml @@ -1,10 +1,7 @@ name: Publish on: - push: - branches: - - master - tags: - - 'v[0-9]+.[0-9]+.[0-9]+' + release: + types: [published] env: Configuration: Release ProjectDir: src\SourceGenerator.Foundations\ @@ -15,7 +12,6 @@ jobs: name: build, bundle & publish runs-on: windows-latest steps: - # CheckOut - uses: actions/checkout@v3 with: ref: ${{ github.head_ref }} # checkout the correct branch name @@ -24,9 +20,15 @@ jobs: uses: actions/setup-dotnet@v3 with: dotnet-version: 6.0.x - - run: dotnet tool restore - - run: dotnet gitversion /output buildserver - - run: dotnet build ${{env.SolutionPath}} -t:build -p:Version=${{env.GitVersion_AssemblySemVer}} --configuration ${{env.Configuration}} - - run: dotnet test ${{env.SolutionPath}} - - run: dotnet build ${{env.SolutionPath}} -t:pack -p:PackageVersion=${{env.GitVersion_SemVer}} --configuration ${{env.Configuration}} - - 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 + - name: Restore + run: dotnet tool restore + - name: GitVersion + run: dotnet gitversion /output buildserver + - name: Build + run: dotnet build ${{env.SolutionPath}} -t:build -p:Version=${{env.GitVersion_AssemblySemVer}} --configuration ${{env.Configuration}} + - name: Test + run: dotnet test ${{env.SolutionPath}} + - name: Build + run: dotnet build ${{env.SolutionPath}} -t:pack -p:PackageVersion=${{env.GitVersion_SemVer}} --configuration ${{env.Configuration}} + - 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