From 7892cea487618965b221a6ca4493e3d6aa174eba Mon Sep 17 00:00:00 2001 From: Simon Novak Date: Sat, 13 May 2023 09:51:37 +0200 Subject: [PATCH 1/4] chore: Updated Escendit.Tools.SourceLink.GitHub.csproj - bump Escendit.Tools.SourceLink.GitHub version. --- .../Escendit.Tools.SourceLink.GitHub.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Escendit.Tools.SourceLink.GitHub/Escendit.Tools.SourceLink.GitHub.csproj b/src/Escendit.Tools.SourceLink.GitHub/Escendit.Tools.SourceLink.GitHub.csproj index d020c06..760bfa5 100644 --- a/src/Escendit.Tools.SourceLink.GitHub/Escendit.Tools.SourceLink.GitHub.csproj +++ b/src/Escendit.Tools.SourceLink.GitHub/Escendit.Tools.SourceLink.GitHub.csproj @@ -11,7 +11,7 @@ sourcelink;source;link;github;defaults - + From be9d78b1079af71c565b2e99225894f8905472de Mon Sep 17 00:00:00 2001 From: Simon Novak Date: Sat, 13 May 2023 09:53:04 +0200 Subject: [PATCH 2/4] chore: Updated Escendit.Tools.SourceLink.GitHub.props - Added support for automatically filling in RepositoryUrl needed for publishing nuget packages in main and forked repositories. --- .../Escendit.Tools.SourceLink.GitHub.props | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Escendit.Tools.SourceLink.GitHub/Escendit.Tools.SourceLink.GitHub.props b/src/Escendit.Tools.SourceLink.GitHub/Escendit.Tools.SourceLink.GitHub.props index 35d6e09..b740d36 100644 --- a/src/Escendit.Tools.SourceLink.GitHub/Escendit.Tools.SourceLink.GitHub.props +++ b/src/Escendit.Tools.SourceLink.GitHub/Escendit.Tools.SourceLink.GitHub.props @@ -3,6 +3,11 @@ true snupkg - true + + + + git + https://github.com/$(GITHUB_REPOSITORY) + true From 974d82d909bacb17fb9b800465d4f5cb0679be9a Mon Sep 17 00:00:00 2001 From: Simon Novak Date: Sat, 13 May 2023 12:05:10 +0200 Subject: [PATCH 3/4] chore: Updated Directory.Build.props - dynamic repository url for GitHub Actions, to support build in main and forked repositories. --- Directory.Build.props | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Directory.Build.props b/Directory.Build.props index d5abf88..e1822af 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -4,4 +4,8 @@ git https://github.com/escendit/Escendit.Tools.SourceLink.GitHub + + + https://github.com/$(GITHUB_REPOSITORY) + From 7d59c7064544df19ea45bade4164d3361bcb46b2 Mon Sep 17 00:00:00 2001 From: Simon Novak Date: Sat, 13 May 2023 12:21:08 +0200 Subject: [PATCH 4/4] chore: Updated build.yml - Make pack configuration for Release, conditional dotnet push to nuget.org. --- .github/workflows/build.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3321eb3..006ebe7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,11 +21,13 @@ jobs: - name: Build .NET Solution run: dotnet build --configuration Release --no-restore - name: Pack .NET Solution - run: dotnet pack --no-build --output pack/ + run: dotnet pack --configuration Release --no-build --output pack/ - name: Publish .NET Solution to GitHub Packages continue-on-error: true run: dotnet nuget push pack/* --api-key ${{ secrets.GITHUB_TOKEN }} --source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" - name: Publish .NET Solution to NuGet.org - continue-on-error: true + env: + apikey: ${{ secrets.NUGET_ORG_KEY }} + if: ${{ env.apikey != '' }} run: dotnet nuget push pack/* --api-key ${{ secrets.NUGET_ORG_KEY }} --source nuget - + continue-on-error: true