Skip to content
This repository has been archived by the owner on Dec 4, 2024. It is now read-only.

Commit

Permalink
Github Actions Release job
Browse files Browse the repository at this point in the history
  • Loading branch information
willpassidomo committed May 20, 2021
1 parent 6c49667 commit 84d43b1
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ on:
push:

jobs:
Build:
runs-on: macos-latest
steps:
- uses: actions/checkout@v1
- name: Build artifacts
run: ./build.sh

Android:
runs-on: macos-latest
steps:
Expand Down
39 changes: 39 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Release SDK

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@v2
- 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
# All new code is stored in internal/development. Release from public/master will merge changes from internal/development into
# public/master, then run semantic-release on public/master to update changelog and release notes. Before semantic-release publishes
# to npm, it builds the dist/ folder. Finally, commits from public/master are synced back to internal/master and internal/development.

release-to-nuget:
name: Release and Sync Repos
runs-on: macos-latest
needs: ['confirm-master-branch']
steps:
- name: Git checkout
uses: actions/checkout@v2
- name: Build artifacts
run: ./build.sh
- name: Release to Nuget
run: nuget push *.nupkg ${{ secrets.NUGET_API_KEY }} -Source https://api.nuget.org/v3/index.json
14 changes: 14 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
nuget restore
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
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

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

nuget pack Library/mparticle.nuspec

0 comments on commit 84d43b1

Please sign in to comment.