Add checking event == 'push'

This commit is contained in:
Gandifil
2023-03-16 20:16:22 +01:00
parent f8fb2237d2
commit 80189415c3
+7 -7
View File
@@ -31,11 +31,11 @@ jobs:
- name: "Install GitVersion"
uses: gittools/actions/gitversion/setup@v0.9.6
env:
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true # workaround for https://github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/ until the execute action is updated
with:
versionSpec: '5.x'
- name: "Use GitVersion"
uses: gittools/actions/gitversion/execute@v0.9.6
@@ -103,13 +103,13 @@ jobs:
run: dotnet test --nologo --verbosity normal --configuration Release --no-build
- name: "Pack solution"
if: matrix.os == 'ubuntu-latest'
if: matrix.os == 'ubuntu-latest' && github.event_name == 'push'
run: dotnet pack --nologo --output "./nuget-packages" --verbosity minimal --configuration Release --no-build -p:PackageVersion='${{ env.VERSION }}'
- name: "Add Packages Source: MyGet"
if: matrix.os == 'ubuntu-latest'
if: matrix.os == 'ubuntu-latest' && github.event_name == 'push'
run: dotnet nuget add source $MYGET_SOURCE_URL --name "MyGet"
- name: "Upload Packages: MyGet"
if: matrix.os == 'ubuntu-latest'
if: matrix.os == 'ubuntu-latest' && github.event_name == 'push'
run: dotnet nuget push "./**/*.nupkg" --source "MyGet" --skip-duplicate --api-key $MYGET_ACCESS_TOKEN