-
-
Notifications
You must be signed in to change notification settings - Fork 1
57 lines (51 loc) · 2.18 KB
/
publish-nuget.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name: Publish Nuget
run-name: ${{ github.actor }} is publishing NuGet 🚀
on:
workflow_dispatch:
inputs:
SHOULD_RUN:
description: 'True to run'
required: true
type: boolean
jobs:
build-then-publish:
environment: production
runs-on: macos-latest
if: ${{ inputs.SHOULD_RUN }}
steps:
- uses: actions/checkout@v3
- name: Install Xamarin.iOS package using Homebrew
run: |
brew install --cask xamarin-ios
- name: Setup .NET Core SDK 8.x
uses: actions/setup-dotnet@v3
with:
dotnet-version: '8.0'
- name: Install ios workload
run: |
dotnet workload install ios
- name: Build
run: |
sh build.sh
- name: Publish NuGet and symbols
id: nuget-push
uses: edumserrano/[email protected]
with:
api-key: '${{ secrets.NUGET_PUSH_API_KEY }}' # this example is using GitHub secrets to pass the API key
working-directory: 'nugets'
# The next step is using powershell to parse the action's output but you can use whatever you prefer.
# Note that in order to read the step outputs the action step must have an id.
- name: Log output
if: steps.nuget-push.conclusion != 'skipped' && always() # run regardless if the previous step failed or not, just as long as it wasn't skipped
shell: pwsh
run: |
$pushResult = '${{ steps.nuget-push.outputs.push-result }}' | ConvertFrom-Json
$pushResultAsJsonIndented = ConvertTo-Json $pushResult
Write-Output $pushResultAsJsonIndented # outputs the result of the nuget push operation as an indented JSON string
Write-Output '${{ steps.nuget-push.outputs.status }}' # outputs the overall status of the nuget push action
# iterates over all list of packages and outputs the data from the nuget push operation for each
foreach($package in $pushResult.packages) {
Write-Output "$($package.status)" # outputs the status of the nuget push operation
Write-Output "$($package.package)" # outputs the NuGet package name that was pushed
Write-Output "$($package.symbols)" # outputs the symbols package name that was pushed
}