9292 sed -i -E "s/spec=\"com\.onesignal:OneSignal:[0-9][0-9.]*\"/spec=\"com.onesignal:OneSignal:$VERSION\"/" com.onesignal.unity.android/Editor/OneSignalAndroidDependencies.xml
9393 sed -i -E "s/'com\.onesignal:OneSignal:[0-9][0-9.]*'/'com.onesignal:OneSignal:$VERSION'/" OneSignalExample/Assets/Plugins/Android/mainTemplate.gradle
9494 sed -i -E "s/<package>com\.onesignal:OneSignal:[0-9][0-9.]*<\/package>/<package>com.onesignal:OneSignal:$VERSION<\/package>/" OneSignalExample/ProjectSettings/AndroidResolverDependencies.xml
95- git add . && git commit -m "Bump Android SDK $VERSION" && git push
9695
9796 - name : Update iOS SDK version
9897 if : inputs.ios_version != ''
@@ -101,32 +100,6 @@ jobs:
101100 # validate the version exists on GitHub
102101 curl -sfH "Authorization: token ${{ github.token }}" "https://api.github.com/repos/OneSignal/OneSignal-iOS-SDK/releases/tags/${VERSION}" >/dev/null || { echo "✗ iOS SDK version ${VERSION} not found"; exit 1; }
103102 sed -i -E "s/version=\"[0-9][0-9.]*\"/version=\"$VERSION\"/" com.onesignal.unity.ios/Editor/OneSignaliOSDependencies.xml
104- git add . && git commit -m "Bump iOS SDK $VERSION" && git push
105-
106- create-pr :
107- needs : [prep, update-version]
108- uses : OneSignal/sdk-actions/.github/workflows/create-release.yml@main
109- with :
110- release_branch : ${{ needs.prep.outputs.release_branch }}
111- target_branch : ${{ inputs.target_branch }}
112- android_from : ${{ needs.update-version.outputs.android_from }}
113- android_to : ${{ inputs.android_version }}
114- ios_from : ${{ needs.update-version.outputs.ios_from }}
115- ios_to : ${{ inputs.ios_version }}
116-
117- draft-release :
118- needs : [prep, update-version, create-pr]
119- runs-on : ubuntu-latest
120- steps :
121- - name : Checkout
122- uses : actions/checkout@v5
123- with :
124- ref : ${{ needs.prep.outputs.release_branch }}
125-
126- - name : Configure Git
127- run : |
128- git config --global user.email "github-actions[bot]@users.noreply.github.com"
129- git config --global user.name "github-actions[bot]"
130103
131104 - name : Update Unity SDK version
132105 run : |
@@ -144,68 +117,15 @@ jobs:
144117 sed -i "s/\"com.onesignal.unity.core\": \"[0-9.]\+\"/\"com.onesignal.unity.core\": \"${{ inputs.unity_version }}\"/g" OneSignalExample/Packages/packages-lock.json
145118 sed -i "s/bundleVersion: .*/bundleVersion: ${{ inputs.unity_version }}/" OneSignalExample/ProjectSettings/ProjectSettings.asset
146119 sed -i "s/setSdkVersion:@\"[0-9]*\"/setSdkVersion:@\"${PADDED_VERSION}\"/" com.onesignal.unity.ios/Runtime/Plugins/iOS/UIApplication+OneSignalUnity.mm
120+ git add . && git commit -m "Release ${{ inputs.unity_version }}" && git push
147121
148- - name : Get PR release notes
149- id : notes
150- env :
151- GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
152- run : |
153- sudo apt-get update && sudo apt-get install -y gh || true
154- PR_NUMBER=$(gh pr list --head "${{ needs.prep.outputs.release_branch }}" --json number -q '.[0].number' || echo "")
155- if [ -z "$PR_NUMBER" ]; then echo "RELEASE_NOTES=" >> $GITHUB_ENV; exit 0; fi
156- cleaned_notes=$(gh pr view "$PR_NUMBER" --json body -q '.body' | awk 'BEGIN{found=0} /^- Update/{found=1} /^<!-- Reviewable:start -->/{found=0;next} found' | sed '/^- - -$/d' | sed '/^[[:space:]]*$/d')
157- echo "RELEASE_NOTES<<EOF" >> $GITHUB_ENV
158- echo "$cleaned_notes" >> $GITHUB_ENV
159- echo "EOF" >> $GITHUB_ENV
160-
161- - name : Update CHANGELOG.md
162- run : |
163- awk -v ver="${{ inputs.unity_version }}" -v notes="$RELEASE_NOTES" \
164- '/^## \[Unreleased\]/ { print $0; print "## [" ver "]\n### Changed"; print notes "\n"; next } { print $0 }' \
165- OneSignalExample/Assets/OneSignal/CHANGELOG.md > /tmp/changelog.tmp && mv /tmp/changelog.tmp OneSignalExample/Assets/OneSignal/CHANGELOG.md
166-
167- - name : Commit Release
168- run : git add . && git commit -m "Release ${{ inputs.unity_version }}" && git push
169-
170- - name : Cache Unity
171- uses : actions/cache@v4
172- with :
173- path : /home/runner/Unity/Hub
174- key : UnityEditor-${{ runner.os }}
175- restore-keys : UnityEditor-${{ runner.os }}
176-
177- - name : Setup Unity
178- uses : buildalon/unity-setup@v2.1.1
179- with :
180- version-file : ' OneSignalExample/ProjectSettings/ProjectVersion.txt'
181-
182- - uses : buildalon/activate-unity-license@v2
183- with :
184- license : ' Personal'
185- username : ' ${{ secrets.UNITY_USERNAME }}'
186- password : ' ${{ secrets.UNITY_PASSWORD }}'
187-
188- - name : Clean Unity locks
189- run : pkill -f Unity || true; rm -rf OneSignalExample/{Temp,Library,obj,UserSettings} OneSignalExample/Temp/UnityLockfile 2>/dev/null || true
190-
191- - name : Run UpdateProjectVersion
192- uses : buildalon/unity-action@v3
193- with :
194- project-path : OneSignalExample
195- args : -quit -batchmode -nographics -buildTarget Android -executeMethod OneSignalSDK.OneSignalPackagePublisher.UpdateProjectVersion
196-
197- - name : Run ExportUnityPackage
198- uses : buildalon/unity-action@v3
199- with :
200- project-path : OneSignalExample
201- args : -quit -batchmode -nographics -buildTarget Android -executeMethod OneSignalSDK.OneSignalPackagePublisher.ExportUnityPackage
202-
203- - name : Draft Release
204- env :
205- GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
206- run : |
207- package_path="OneSignalExample/OneSignal-v${{ inputs.unity_version }}.unitypackage"
208- gh release create "${{ inputs.unity_version }}" "${package_path}"\
209- --draft\
210- --title "${{ inputs.unity_version }} Release"\
211- --notes "TODO"
122+ create-pr :
123+ needs : [prep, update-version]
124+ uses : OneSignal/sdk-actions/.github/workflows/create-release.yml@main
125+ with :
126+ release_branch : ${{ needs.prep.outputs.release_branch }}
127+ target_branch : ${{ inputs.target_branch }}
128+ android_from : ${{ needs.update-version.outputs.android_from }}
129+ android_to : ${{ inputs.android_version }}
130+ ios_from : ${{ needs.update-version.outputs.ios_from }}
131+ ios_to : ${{ inputs.ios_version }}
0 commit comments