-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathazure-pipeline-public-nuget-publish.yml
68 lines (55 loc) · 2.21 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
63
64
65
66
67
68
trigger:
branches:
include:
- refs/tags/release-v*
pr: none
pool:
vmImage: "macOS-15"
variables:
- group: nuget.org
steps:
- task: UseDotNet@2
inputs:
packageType: "sdk"
useGlobalJson: true
- bash: |
echo "##vso[task.setvariable variable=bindingsVersion]$(cat Tonestro.Maui.RevenueCat.Android/Tonestro.Maui.RevenueCat.Android.csproj | grep '<Version>' | awk -F '[<>]' '{print $3}')"
- bash: |
echo "##vso[build.updatebuildnumber]production-tonestro-maui-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: |
sudo dotnet workload restore
displayName: Restore workloads
- bash: |
cd Tonestro.Maui.RevenueCat.Android
dotnet build -c Release
dotnet pack -c Release
displayName: "Tonestro.Maui.RevenueCat.Android: Build Release Nuget"
- bash: |
cd Tonestro.Maui.RevenueCat.Android.Extensions
dotnet build -c Release
dotnet pack -c Release
displayName: "Tonestro.Maui.RevenueCat.Android.Extensions: Build Release Nuget"
- bash: |
./copy-nugets.sh
displayName: "Copy nugets to nugetoutput folder"
- bash: |
dotnet nuget push nugetoutput/Tonestro.Maui.RevenueCat.Android.$(bindingsVersion).nupkg -k "$(nugetOrgApiKey)" -s https://api.nuget.org/v3/index.json
dotnet nuget push nugetoutput/Tonestro.Maui.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/Tonestro.Maui.RevenueCat.Android"
action: "create"
target: "$(Build.SourceVersion)"
tagSource: "userSpecifiedTag"
tag: "$(Build.SourceBranchName)"
title: "Tonestro.Maui.RevenueCat.Android $(bindingsVersion)"
assets: "nugetoutput/Tonestro.Maui.RevenueCat.Android.*.nupkg"
changeLogCompareToRelease: "lastFullRelease"
changeLogType: "issueBased"