-
Notifications
You must be signed in to change notification settings - Fork 5
/
azure-pipeline-public-nuget-publish.yml
62 lines (50 loc) · 2.07 KB
/
azure-pipeline-public-nuget-publish.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
trigger:
branches:
include:
- refs/tags/release-v*
pr: none
pool:
vmImage: 'macOS-12'
variables:
- group: nuget.org
steps:
- bash: |
echo "##vso[task.setvariable variable=bindingsVersion]$(cat Xamarin.RevenueCat.Android/Xamarin.RevenueCat.Android.csproj | grep '<Version>' | awk -F '[<>]' '{print $3}')"
- bash: |
echo "##vso[build.updatebuildnumber]production-xamarin-revenuecat-android-bindings-$(Build.SourceBranchName)-$(Build.BuildId)"
- bash: |
if [[ "$(Build.SourceBranchName)" != *"$(bindingsVersion)" ]]; then
echo "mismatch between tag $(Build.SourceBranchName) and nuget version $(bindingsVersion)"
exit 1
fi
- bash: |
cd Xamarin.RevenueCat.Android
msbuild /t:Restore /p:Configuration=Release
msbuild /t:Build /p:Configuration=Release
msbuild /t:Pack /p:Configuration=Release
displayName: "Xamarin.RevenueCat.Android: Build Release Nuget"
- bash: |
cd Xamarin.RevenueCat.Android.Extensions
msbuild /t:Restore /p:Configuration=Release
msbuild /t:Build /p:Configuration=Release
msbuild /t:Pack /p:Configuration=Release
displayName: "Xamarin.RevenueCat.Android.Extensions: Build Release Nuget"
- bash: |
./copy-nugets.sh
displayName: "Copy nugets to nugetoutput folder"
- bash: |
dotnet nuget push nugetoutput/Xamarin.RevenueCat.Android.$(bindingsVersion).nupkg -k "$(nugetOrgApiKey)" -s https://api.nuget.org/v3/index.json
dotnet nuget push nugetoutput/Xamarin.RevenueCat.Android.Extensions.$(bindingsVersion).nupkg -k "$(nugetOrgApiKey)" -s https://api.nuget.org/v3/index.json
displayName: "Publish nuget packages to nuget.org"
- task: GitHubRelease@1
inputs:
gitHubConnection: 'github.com_thisisthekap'
repositoryName: 'thisisthekap/Xamarin.RevenueCat.Android'
action: 'create'
target: '$(Build.SourceVersion)'
tagSource: 'userSpecifiedTag'
tag: '$(Build.SourceBranchName)'
title: 'Xamarin.RevenueCat.Android $(bindingsVersion)'
assets: 'nugetoutput/Xamarin.RevenueCat.Android.*.nupkg'
changeLogCompareToRelease: 'lastFullRelease'
changeLogType: 'issueBased'