Skip to content

Commit

Permalink
Fix build script and (hopefully) fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
einsteinx2 committed Aug 14, 2024
1 parent 2185ff6 commit 4a82a4f
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 48 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ on:

jobs:
Build:
runs-on: macOS-13
runs-on: macOS-14
steps:
- uses: actions/checkout@v4
- name: Build artifacts
run: ./build.sh

Android:
runs-on: macos-13
runs-on: macos-14
steps:
- uses: actions/checkout@v4
- name: Android
Expand All @@ -22,7 +22,7 @@ jobs:
dotnet build
iOS:
runs-on: macos-13
runs-on: macos-14
steps:
- uses: actions/checkout@v4
- name: iOS
Expand Down
25 changes: 6 additions & 19 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,15 @@ on:
workflow_dispatch:

jobs:
# SDK release is done from public/master branch.
confirm-master-branch:
name: Confirm release is run on public/master branch
runs-on: ubuntu-latest
steps:
- name: Git checkout
uses: actions/checkout@v4
- name: Branch name
run: |
BRANCHNAME=${GITHUB_REF##*/}
echo "pulling branch name, branch name is:"
echo $BRANCHNAME
if [ $BRANCHNAME != "master" ]
then
echo "You can only run a release from the master branch, you are trying to run it from ${BRANCHNAME}"
exit 1
fi
# SDK release is done from main branch.
confirm-main-branch:
name: Confirm release is run from main branch
uses: mParticle/mparticle-workflows/.github/workflows/sdk-release-repo-branch-check.yml@stable

release-to-nuget:
name: Release and Sync Repos
runs-on: macos-13
needs: ['confirm-master-branch']
runs-on: macos-14
needs: ['confirm-main-branch']
steps:
- name: Git checkout
uses: actions/checkout@v4
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ publish

# NuGet Packages Directory
packages
*.nupkg

# Windows Azure Build Output
csx
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 7 additions & 20 deletions Library/mparticle.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -3,40 +3,28 @@
<metadata minClientVersion="2.8.1">
<id>mParticle.Xamarin</id>
<version>2.1.0</version>
<title>mParticle .Net SDK</title>
<title>mParticle .NET MAUI and Xamarin SDK</title>
<authors>Wasi Haider, Sam Dozor, Will Passidomo, Brandon Stalnaker, mParticle Inc.</authors>
<owners>mParticle Inc.</owners>
<licenseUrl>https://github.com/mParticle/mparticle-xamarin-sdk/blob/master/LICENSE</licenseUrl>
<projectUrl>https://github.com/mparticle/mparticle-xamarin-sdk</projectUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<iconUrl>https://static.mparticle.com/sdk/nuget_logo.png</iconUrl>
<description>
mParticle .NET SDK
mParticle .NET MAUI and Xamarin SDK
</description>
<summary>
mParticle .NET SDK
mParticle .NET MAUI and Xamarin SDK
</summary>
<tags>mparticle, analytics, marketing, maui, xamarin, xamarin.forms, android, ios, plugin for xamarin</tags>
<dependencies>
<group targetFramework="net">
</group>
<group targetFramework="MonoAndroid10">
</group>
<group targetFramework="Xamarin.iOS10">
</group>
<group targetFramework="portable-net45+win+wpa81+wp80">
</group>
<group targetFramework="net8.0-ios">
</group>
<group targetFramework="net8.0-android">
</group>
</group>
<group targetFramework="MonoAndroid10"></group>
<group targetFramework="Xamarin.iOS10"></group>
<group targetFramework="net8.0-ios17.5"></group>
<group targetFramework="net8.0-android33.0"></group>
</dependencies>
</metadata>
<files>

<!--Core-->
<file src="mParticle.Xamarin/bin/Release/mParticle.*" target="lib/portable-net45+win+wpa81+wp80" />

<!--Xamarin.Android-->
<file src="mParticle.Xamarin.Android/bin/Release/mParticle.*" target="lib/MonoAndroid10" />
Expand All @@ -50,6 +38,5 @@
<!--MAUI.Android-->
<file src="mParticle.MAUI.Android/bin/Release/mParticle.*" target="lib/net8.0-android" />


</files>
</package>
40 changes: 35 additions & 5 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,46 @@
#!/bin/bash

# Xamarin
#

# Restore packages
nuget restore

# Build bindings
msbuild Bindings/mParticle.Xamarin.AndroidBinding/mParticle.Xamarin.AndroidBinding.csproj /p:Configuration=Release /t:Rebuild
msbuild Bindings/mParticle.Xamarin.iOSBinding/mParticle.Xamarin.iOSBinding.csproj /p:Configuration=Release /t:Rebuild
msbuild Library/mParticle.Xamarin/mParticle.Xamarin.csproj /p:Configuration=Release /t:Rebuild

# Build Libraries
msbuild Library/mParticle.Xamarin.Abstractions/mParticle.Xamarin.Abstractions.csproj /p:Configuration=Release /t:Rebuild
msbuild Library/mParticle.Xamarin.Android/mParticle.Xamarin.Android.csproj /p:Configuration=Release /t:Rebuild
msbuild Library/mParticle.Xamarin.iOS/mParticle.Xamarin.iOS.csproj /p:Configuration=Release /t:Rebuild



# Build Sample Apps
msbuild Samples/mParticle.Xamarin.Android.Sample/mParticle.Xamarin.Android.Sample.csproj /p:Configuration=Debug /t:Rebuild
msbuild Samples/mParticle.Xamarin.Forms.Sample.Droid/mParticle.Xamarin.Forms.Sample.Droid.csproj /p:Configuration=Debug /t:Rebuild
msbuild Samples/mParticle.Xamarin.Forms.Sample.iOS/mParticle.Xamarin.Forms.Sample.iOS.csproj /p:Configuration=Debug /t:Rebuild
msbuild Samples/mParticle.Xamarin.iOS.Sample/mParticle.Xamarin.iOS.Sample.csproj /p:Configuration=Debug /t:Rebuild


# .NET MAUI
#

# Restore packages
dotnet restore

# Build bindings
dotnet build Bindings/mParticle.MAUI.AndroidBinding/mParticle.MAUI.AndroidBinding.csproj /p:Configuration=Release /t:Rebuild
dotnet build Bindings/mParticle.MAUI.iOSBinding/mParticle.MAUI.iOSBinding.csproj /p:Configuration=Release /t:Rebuild

# Build Libraries
dotnet build Library/mParticle.MAUI.Abstractions/mParticle.MAUI.Abstractions.csproj /p:Configuration=Release /t:Rebuild
dotnet build Library/mParticle.MAUI.Android/mParticle.MAUI.Android.csproj /p:Configuration=Release /t:Rebuild
dotnet build Library/mParticle.MAUI.iOS/mParticle.MAUI.iOS.csproj /p:Configuration=Release /t:Rebuild

# Build Sample Apps
dotnet build Samples/mParticle.MAUI.Android.Sample/mParticle.MAUI.Android.Sample.csproj /p:Configuration=Debug /t:Rebuild
dotnet build Samples/mParticle.MAUI.iOS.Sample/mParticle.MAUI.iOS.Sample.csproj /p:Configuration=Debug /t:Rebuild


# Package for nuget
#

nuget pack Library/mparticle.nuspec

0 comments on commit 4a82a4f

Please sign in to comment.