gha: Add steps to upload nupkg as artifact & publish to Nuget
This commit is contained in:
29
.github/workflows/Nuget-publishing.yml
vendored
29
.github/workflows/Nuget-publishing.yml
vendored
@@ -124,7 +124,7 @@ jobs:
|
||||
|
||||
- name: '📤 Upload artifact'
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v1
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
path: ./${{ matrix.config.artifact }}
|
||||
name: ${{ matrix.config.artifact }}
|
||||
@@ -182,7 +182,7 @@ jobs:
|
||||
|
||||
- name: '📤 Upload artifact'
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v1
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
path: ./${{ matrix.config.artifact }}
|
||||
name: ${{ matrix.config.artifact }}
|
||||
@@ -307,7 +307,7 @@ jobs:
|
||||
|
||||
- name: '📤 Upload artifact'
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v1
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
path: ./${{ matrix.config.artifact }}
|
||||
name: ${{ matrix.config.artifact }}
|
||||
@@ -320,12 +320,12 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Download artifacts
|
||||
- name: 🛠️ Download artifacts
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
path: artifacts
|
||||
|
||||
- name: Extract artifacts
|
||||
- name: 🛠️ Extract artifacts
|
||||
shell: python
|
||||
run: |
|
||||
import subprocess
|
||||
@@ -397,7 +397,7 @@ jobs:
|
||||
|
||||
print("Done!")
|
||||
|
||||
- name: Get short sha
|
||||
- name: 🛠️ Get short sha
|
||||
id: git_short_sha
|
||||
run: echo "result=$(git rev-parse --short "${{ github.sha }}")" >> $GITHUB_OUTPUT
|
||||
|
||||
@@ -405,21 +405,32 @@ jobs:
|
||||
with:
|
||||
dotnet-version: 6.0.x
|
||||
|
||||
- name: Authenticate to Github Packages
|
||||
- name: 🛠️ Authenticate to Github Packages
|
||||
working-directory: bindings/dotnet/UnicornEngine
|
||||
run: dotnet nuget add source --username "${{ github.repository_owner }}" --password "${{ secrets.GITHUB_TOKEN }}" --store-password-in-clear-text --name github "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json"
|
||||
|
||||
- name: List all native libraries
|
||||
- name: 🛠️ List all native libraries
|
||||
working-directory: bindings/dotnet/UnicornEngine
|
||||
run: find ./runtimes -type f -print
|
||||
|
||||
- name: Package .NET distribution
|
||||
- name: 🚧 Package .NET distribution
|
||||
working-directory: bindings/dotnet/UnicornEngine
|
||||
run: |
|
||||
[[ "${{ github.ref_name }}" == "master" ]] \
|
||||
&& dotnet pack -c Release \
|
||||
|| dotnet pack -c Release --version-suffix="${{ steps.git_short_sha.outputs.result }}"
|
||||
|
||||
- name: '📤 Upload artifact'
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
path: ${{ github.workspace }}/bindings/dotnet/UnicornEngine/bin/Release/UnicornEngine.Unicorn.*.nupkg
|
||||
|
||||
- name: 📦 Publish to Github Packages
|
||||
working-directory: bindings/dotnet/UnicornEngine
|
||||
run: dotnet nuget push "bin/Release/UnicornEngine.Unicorn.*.nupkg" --source "github" --api-key "${{ secrets.GHPR_TOKEN }}"
|
||||
|
||||
- name: 📦 Publish Nuget package
|
||||
working-directory: bindings/dotnet/UnicornEngine
|
||||
run: dotnet nuget push "bin/Release/UnicornEngine.Unicorn.*.nupkg" -k "$NUGET_AUTH_TOKEN" -s https://api.nuget.org/v3/index.json
|
||||
env:
|
||||
NUGET_AUTH_TOKEN: ${{ secrets.NUGET_KEY }}
|
||||
|
||||
Reference in New Issue
Block a user