[Actions] Fix Deploy to push GitHub Packages (#5729)
[platform/core/csapi/tizenfx.git] / .github / workflows / deploy-packages.yml
index 15e6932..d7fcd5b 100644 (file)
@@ -7,6 +7,10 @@ on:
         description: 'Branch to deploy'
         required: true
         default: 'master'
+      deploy_to_gpr:
+        description: 'Deploy packages to Github Packages Registry?'
+        required: true
+        default: true
       deploy_to_myget:
         description: 'Deploy packages to MyGet?'
         required: true
@@ -23,7 +27,7 @@ jobs:
   deploy:
     runs-on: ubuntu-20.04
     steps:
-    - uses: actions/checkout@v2
+    - uses: actions/checkout@v3
       with:
         ref: ${{ env.TARGET_BRANCH }}
         fetch-depth: 0
@@ -67,6 +71,14 @@ jobs:
         git tag -fa "v$VERSION" -m "Release $VERSION"
         git push -f --tags origin refs/tags/"v$VERSION"
 
+    - name: Deploy NuGet packages to Github Packages Registry
+      if: github.event.inputs.deploy_to_gpr == 'true'
+      env:
+        PACKAGES_SOURCE: https://nuget.pkg.github.com/Samsung/index.json
+        APIKEY: ${{ secrets.GITHUB_TOKEN }}
+      run: |
+        dotnet nuget push Artifacts/*.nupkg -k $APIKEY -s $PACKAGES_SOURCE -t 3000
+
     - name: Deploy NuGet packages to MyGet
       if: github.event.inputs.deploy_to_myget == 'true'
       env: