Skip to content

Commit 5343a8a

Browse files
author
AR Abdul Azeez
committed
merging from main
2 parents 7fdbecc + 8116c60 commit 5343a8a

20 files changed

Lines changed: 228 additions & 234 deletions

File tree

.github/workflows/publish-release.yml

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
name: Publish Release
22

33
on:
4-
pull_request:
5-
types:
6-
- closed
4+
push:
75
branches:
86
- main
97

@@ -13,7 +11,7 @@ permissions:
1311

1412
jobs:
1513
publish:
16-
if: github.event.pull_request.merged == true && startsWith(github.event.pull_request.head.ref, 'rel/')
14+
if: contains(github.event.head_commit.message, 'rel/')
1715
runs-on: ubuntu-latest
1816

1917
env:
@@ -25,10 +23,8 @@ jobs:
2523
GPG_FILE_NAME: onesignal_sdk_gpg_subkeys
2624

2725
steps:
28-
- name: Checkout release branch
29-
uses: actions/checkout@v3
30-
with:
31-
ref: ${{ github.event.pull_request.head.ref }}
26+
- name: Checkout main
27+
uses: actions/checkout@v5
3228

3329
- name: Ensure Java 11 or 17
3430
run: |
@@ -58,6 +54,15 @@ jobs:
5854
run: ./gradlew assembleRelease
5955
working-directory: OneSignalSDK
6056

57+
- name:
58+
Dry Run: Publish to Maven Local with signing
59+
run: |
60+
./gradlew publishToMavenLocal --no-configuration-cache \
61+
-Psigning.keyId="$SDK_SIGNING_KEY_ID" \
62+
-Psigning.password="$SDK_SIGNING_PASSWORD" \
63+
-Psigning.secretKeyRingFile="$(pwd)/$GPG_FILE_NAME"
64+
working-directory: OneSignalSDK
65+
6166
- name: Publish to Maven Central
6267
run: |
6368
./gradlew publishAndReleaseToMavenCentral --no-configuration-cache \
@@ -68,14 +73,10 @@ jobs:
6873
-Psigning.secretKeyRingFile="$(pwd)/$GPG_FILE_NAME"
6974
working-directory: OneSignalSDK
7075

71-
- name: Authenticate gh CLI
72-
run: echo "${{ secrets.GITHUB_TOKEN }}" | gh auth login --with-token
73-
7476
- name: Tag and create GitHub Release
7577
run: |
7678
VERSION="${{ env.SDK_VERSION }}"
7779
78-
# Determine release channel
7980
if [[ "$VERSION" == *"alpha"* ]]; then
8081
PRERELEASE="--prerelease"
8182
CHANNEL="alpha"
@@ -87,15 +88,17 @@ jobs:
8788
CHANNEL="current"
8889
fi
8990
90-
# Extract PR body as release notes
91-
PR_NUMBER=$(echo "${{ github.event.pull_request.number }}")
92-
PR_BODY=$(gh pr view "$PR_NUMBER" --json body -q ".body")
91+
# Fetch PR body using the commit SHA
92+
PR_BODY=$(gh api /repos/${{ github.repository }}/commits/${{ github.sha }}/pulls \
93+
-H "Accept: application/vnd.github.groot-preview+json" \
94+
--jq '.[0].body')
95+
9396
echo -e "Channels: $CHANNEL\n\n$PR_BODY" > release_notes.md
9497
9598
git config user.name "github-actions[bot]"
9699
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
97100
98-
echo "Tagging release v$VERSION"
101+
echo "Tagging release $VERSION"
99102
git tag "$VERSION"
100103
git push origin "$VERSION"
101104
@@ -105,5 +108,4 @@ jobs:
105108
--notes-file release_notes.md \
106109
$PRERELEASE
107110
env:
108-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
109-
111+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 29 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,37 @@
1-
# See https://help.github.com/articles/ignoring-files for more about ignoring files.
2-
#
3-
# If you find yourself ignoring temporary files generated by your text editor
4-
# or operating system, you probably want to add a global ignore instead:
5-
# git config --global core.excludesfile '~/.gitignore_global'
1+
# Gradle
2+
.gradle/
3+
build/
4+
*/build/
65

6+
# Local properties
7+
local.properties
8+
OneSignalSDK/local.properties
9+
Examples/OneSignalDemo/local.properties
710

8-
# Ignore all logfiles and tempfiles.
9-
/log/*.log
10-
/tmp
11+
# macOS
12+
.DS_Store
1113

12-
# built application files
13-
*.apk
14-
*.ap_
15-
16-
# files for the dex VM
17-
*.dex
14+
# IDE files
15+
.idea/
16+
*.iml
1817

19-
# Java class files
20-
*.class
18+
# Captures
19+
captures/
20+
OneSignalSDK/captures/
21+
Examples/OneSignalDemo/captures/
2122

22-
# generated files
23-
bin/
24-
gen/
23+
# GPG files
24+
*.gpg
2525

26-
# Proguard folder generated by Eclipse
27-
proguard/
26+
# Misc
27+
*.log
28+
*.tmp
29+
*.swp
30+
*.swo
2831

29-
# Examples
32+
# Node modules (if using JS tooling)
33+
node_modules/
3034

31-
.idea/
32-
Examples/.idea/
33-
Examples/AndroidStudio/
34-
Examples/OneSignalDemo/app/build/
35-
OneSignalSDK/app/build/
35+
# Android Studio
36+
*.apk
37+
*.ap_

Examples/OneSignalDemo/.idea/vcs.xml

Lines changed: 0 additions & 6 deletions
This file was deleted.

Examples/OneSignalDemo/app/app.iml

Lines changed: 0 additions & 150 deletions
This file was deleted.

Examples/OneSignalDemo/app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,12 @@ dependencies {
8585
implementation 'com.github.bumptech.glide:glide:4.12.0'
8686

8787
/** START - Google Play Builds **/
88-
gmsImplementation('com.onesignal:OneSignal:5.1.37')
88+
gmsImplementation("com.onesignal:OneSignal:$SDK_VERSION")
8989
/** END - Google Play Builds **/
9090

9191
/** START - Huawei Builds **/
9292
// Omit Google / Firebase libraries for Huawei builds.
93-
huaweiImplementation('com.onesignal:OneSignal:5.1.37') {
93+
huaweiImplementation("com.onesignal:OneSignal:$SDK_VERSION") {
9494
exclude group: 'com.google.android.gms', module: 'play-services-gcm'
9595
exclude group: 'com.google.android.gms', module: 'play-services-analytics'
9696
exclude group: 'com.google.android.gms', module: 'play-services-location'

Examples/OneSignalDemo/build.gradle

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ allprojects {
3030
}
3131
}
3232

33+
subprojects {
34+
ext.SDK_VERSION = rootProject.findProperty("SDK_VERSION") ?: "x.x.x"
35+
}
36+
3337
task clean(type: Delete) {
3438
delete rootProject.buildDir
3539
}

Examples/OneSignalDemo/gradle.properties

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,7 @@
1414
org.gradle.jvmargs=-Xmx1536m
1515
android.useAndroidX=true
1616
android.enableJetifier=false
17+
18+
# This is the name of the SDK to use when building your project.
19+
# This will be fed from the GitHub Actions workflow.
20+
SDK_VERSION=5.1.37

Examples/OneSignalDemo/local.properties

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)