Skip to content

Commit 82ddd0a

Browse files
committed
- config CI/CD
1 parent 085567b commit 82ddd0a

File tree

4 files changed

+67
-10
lines changed

4 files changed

+67
-10
lines changed

.github/workflows/publish-nuget.yml

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

build.sh

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
dotnet nuget locals -c all
2+
dotnet pack -c Release -t:Clean,Rebuild src/libs/Mapbox.Maui/Mapbox.Maui.csproj --output $PWD/nugets

src/libs/Mapbox.Maui/Mapbox.Maui.csproj

+4-7
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@
1414
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'tizen'">6.5</SupportedOSPlatformVersion>
1515
<RootNamespace>MapboxMaui</RootNamespace>
1616
</PropertyGroup>
17-
18-
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net6.0-ios|AnyCPU'">
19-
<CreatePackage>false</CreatePackage>
20-
</PropertyGroup>
2117
<!-- Android -->
2218
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
2319
<WarningLevel>4</WarningLevel>
@@ -52,13 +48,14 @@
5248

5349
<ItemGroup Condition="'$(TargetFramework)' == 'net6.0-android'">
5450
<PackageReference Include="Com.Mapbox.Maps.Android" Version="10.11.1" />
55-
<PackageReference Include="Xamarin.Kotlin.StdLib.Jdk8" Version="1.8.10" />
51+
<PackageReference Include="Xamarin.Kotlin.StdLib.Jdk8" Version="1.8.21.1" />
5652
<PackageReference Include="Square.OkHttp3" Version="4.10.0.1" />
57-
<PackageReference Include="Xamarin.Kotlin.StdLib" Version="1.8.10" />
53+
<PackageReference Include="Xamarin.Kotlin.StdLib" Version="1.8.21.1" />
54+
<PackageReference Include="Xamarin.AndroidX.Annotation" Version="1.6.0.2" />
5855
</ItemGroup>
5956

6057
<ItemGroup Condition="'$(TargetFramework)' == 'net6.0-ios'">
61-
<PackageReference Include="MapboxMapsObjC.iOS" Version="10.11.1-alpha4" />
58+
<PackageReference Include="MapboxMapsObjC.iOS" Version="10.11.1" />
6259
<PackageReference Include="MapboxMobileEvents.iOS" Version="1.0.10" />
6360
</ItemGroup>
6461
<ItemGroup>

src/qs/MapboxMauiQs/MapboxMauiQs.csproj

+5-3
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
<UseMaui>true</UseMaui>
99
<SingleProject>true</SingleProject>
1010
<ImplicitUsings>enable</ImplicitUsings>
11+
<IsPackable>false</IsPackable>
1112

1213
<!-- Display name -->
1314
<ApplicationTitle>MapboxQs</ApplicationTitle>
@@ -74,12 +75,13 @@
7475

7576
<ItemGroup Condition="'$(TargetFramework)' == 'net7.0-android'">
7677
<PackageReference Include="Com.Mapbox.Maps.Android" Version="10.11.1" />
77-
<PackageReference Include="Xamarin.Kotlin.StdLib.Jdk8" Version="1.8.10" />
78+
<PackageReference Include="Xamarin.Kotlin.StdLib.Jdk8" Version="1.8.21.1" />
7879
<PackageReference Include="Square.OkHttp3" Version="4.10.0.1" />
79-
<PackageReference Include="Xamarin.Kotlin.StdLib" Version="1.8.10" />
80+
<PackageReference Include="Xamarin.Kotlin.StdLib" Version="1.8.21.1" />
81+
<PackageReference Include="Xamarin.AndroidX.Annotation" Version="1.6.0.2" />
8082
</ItemGroup>
8183
<ItemGroup Condition="'$(TargetFramework)' == 'net7.0-ios'">
82-
<PackageReference Include="MapboxMapsObjC.iOS" Version="10.11.1-alpha4" />
84+
<PackageReference Include="MapboxMapsObjC.iOS" Version="10.11.1" />
8385
<PackageReference Include="MapboxMobileEvents.iOS" Version="1.0.10" />
8486
<PackageReference Include="MapboxMaps.iOS" Version="10.11.1" />
8587
</ItemGroup>

0 commit comments

Comments
 (0)