Skip to content

Commit

Permalink
Only push NuGet from main repo (#110)
Browse files Browse the repository at this point in the history
  • Loading branch information
jfversluis authored Mar 29, 2024
1 parent dfbf743 commit 88ccccd
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,21 @@ jobs:

- name: Build
run: dotnet build src\Plugin.Maui.Audio\Plugin.Maui.Audio.csproj -c Release

- name: Pack
if: github.repository_owner == 'jfversluis' # Only run when on main repo, secrets are not available to forks
run: dotnet pack src\Plugin.Maui.Audio\Plugin.Maui.Audio.csproj -o output -p:PackageVersion=${{ env.NuGetVersion }}

- name: Add NuGet Source for Push
if: github.repository_owner == 'jfversluis' # Only run when on main repo, secrets are not available to forks
run: dotnet nuget add source https://jfversluis.pkgs.visualstudio.com/Plugin.Maui.Audio/_packaging/Plugin.Maui.Audio/nuget/v3/index.json --name PrivateFeed --username ${{ secrets.PUBLISH_USER }} --password ${{ secrets.PUBLISH_PAT }}

- name: Push
if: github.repository_owner == 'jfversluis' # Only run when on main repo, secrets are not available to forks
run: dotnet nuget push "output\*.nupkg" --source PrivateFeed --api-key AzureArtifacts

- name: Create status
if: success() && github.event_name == 'pull_request'
if: success() && github.event_name == 'pull_request' && github.repository_owner == 'jfversluis' # Only run when on main repo, secrets are not available to forks
shell: bash
run: |
curl --request POST \
Expand Down

0 comments on commit 88ccccd

Please sign in to comment.