This repository has been archived by the owner on Jul 16, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
70 lines (63 loc) · 2.77 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
58
59
60
61
62
63
64
65
66
67
68
69
70
name: Publish Nuget
run-name: ${{ github.actor }} is publishing NuGet 🚀
on:
push:
branches: [ main, master ]
# pull_request:
# branches: [ main, master ]
jobs:
build-then-publish:
environment: production
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- name: Set default Xamarin SDK versions
run: |
$VM_ASSETS/select-xamarin-sdk-v2.sh --mono=6.12 --android=13.0
- name: Install Cake-Tool
run: dotnet tool install -g Cake.Tool
id: cake-tool
- name: Install Xamarin.AndroidBinderator.Tool
run: dotnet tool install -g Xamarin.AndroidBinderator.Tool
id: xamarin-androidbinderator-tool
- name: Setup .NET Core SDK 6.0.403
uses: actions/setup-dotnet@v3
with:
dotnet-version: '6.0.403'
- name: Install android workload
run: |
dotnet workload install android
- name: Build
run: |
sh build.sh --target=ci
- name: Publish with Dotnet CLI
env:
NUGET_PUSH_API_KEY: ${{ secrets.NUGET_PUSH_API_KEY }}
shell: bash
run: |
dotnet nuget push ./nugets/*.nupkg --api-key "$NUGET_PUSH_API_KEY" --source https://api.nuget.org/v3/index.json --skip-duplicate
# publish:
# runs-on: macos-latest
# steps:
# - 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
# }