Skip to content

Commit

Permalink
- config CI/CD
Browse files Browse the repository at this point in the history
  • Loading branch information
tuyen-vuduc committed Jul 15, 2023
1 parent 085567b commit 82ddd0a
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 10 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/publish-nuget.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
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: Set default Xamarin SDK versions
run: |
$VM_ASSETS/select-xamarin-sdk-v2.sh --mono=6.12 --android=13.0
- name: Setup .NET Core SDK 7.0.101
uses: actions/setup-dotnet@v3
with:
dotnet-version: '7.0.101'

- name: Install ios workload
run: |
dotnet workload install ios android maui maui-ios maui-android
- 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
}
2 changes: 2 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dotnet nuget locals -c all
dotnet pack -c Release -t:Clean,Rebuild src/libs/Mapbox.Maui/Mapbox.Maui.csproj --output $PWD/nugets
11 changes: 4 additions & 7 deletions src/libs/Mapbox.Maui/Mapbox.Maui.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'tizen'">6.5</SupportedOSPlatformVersion>
<RootNamespace>MapboxMaui</RootNamespace>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net6.0-ios|AnyCPU'">
<CreatePackage>false</CreatePackage>
</PropertyGroup>
<!-- Android -->
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<WarningLevel>4</WarningLevel>
Expand Down Expand Up @@ -52,13 +48,14 @@

<ItemGroup Condition="'$(TargetFramework)' == 'net6.0-android'">
<PackageReference Include="Com.Mapbox.Maps.Android" Version="10.11.1" />
<PackageReference Include="Xamarin.Kotlin.StdLib.Jdk8" Version="1.8.10" />
<PackageReference Include="Xamarin.Kotlin.StdLib.Jdk8" Version="1.8.21.1" />
<PackageReference Include="Square.OkHttp3" Version="4.10.0.1" />
<PackageReference Include="Xamarin.Kotlin.StdLib" Version="1.8.10" />
<PackageReference Include="Xamarin.Kotlin.StdLib" Version="1.8.21.1" />
<PackageReference Include="Xamarin.AndroidX.Annotation" Version="1.6.0.2" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net6.0-ios'">
<PackageReference Include="MapboxMapsObjC.iOS" Version="10.11.1-alpha4" />
<PackageReference Include="MapboxMapsObjC.iOS" Version="10.11.1" />
<PackageReference Include="MapboxMobileEvents.iOS" Version="1.0.10" />
</ItemGroup>
<ItemGroup>
Expand Down
8 changes: 5 additions & 3 deletions src/qs/MapboxMauiQs/MapboxMauiQs.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<UseMaui>true</UseMaui>
<SingleProject>true</SingleProject>
<ImplicitUsings>enable</ImplicitUsings>
<IsPackable>false</IsPackable>

<!-- Display name -->
<ApplicationTitle>MapboxQs</ApplicationTitle>
Expand Down Expand Up @@ -74,12 +75,13 @@

<ItemGroup Condition="'$(TargetFramework)' == 'net7.0-android'">
<PackageReference Include="Com.Mapbox.Maps.Android" Version="10.11.1" />
<PackageReference Include="Xamarin.Kotlin.StdLib.Jdk8" Version="1.8.10" />
<PackageReference Include="Xamarin.Kotlin.StdLib.Jdk8" Version="1.8.21.1" />
<PackageReference Include="Square.OkHttp3" Version="4.10.0.1" />
<PackageReference Include="Xamarin.Kotlin.StdLib" Version="1.8.10" />
<PackageReference Include="Xamarin.Kotlin.StdLib" Version="1.8.21.1" />
<PackageReference Include="Xamarin.AndroidX.Annotation" Version="1.6.0.2" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net7.0-ios'">
<PackageReference Include="MapboxMapsObjC.iOS" Version="10.11.1-alpha4" />
<PackageReference Include="MapboxMapsObjC.iOS" Version="10.11.1" />
<PackageReference Include="MapboxMobileEvents.iOS" Version="1.0.10" />
<PackageReference Include="MapboxMaps.iOS" Version="10.11.1" />
</ItemGroup>
Expand Down

0 comments on commit 82ddd0a

Please sign in to comment.