Skip to content

Commit 8f47b6f

Browse files
authored
Merge pull request #1340 from OneSignal/add_cd
Add release workflow github action
2 parents 1772f49 + 7ead9c2 commit 8f47b6f

File tree

3 files changed

+82
-2
lines changed

3 files changed

+82
-2
lines changed

.github/workflows/cd.yml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: iOS CD
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
type: string
8+
description: "The version number of the release"
9+
required: true
10+
release_branch:
11+
type: string
12+
description: "The release branch with bumped version numbers for the release"
13+
required: true
14+
15+
jobs:
16+
build:
17+
name: Build the binaries for the release and create a PR
18+
runs-on: macos-13
19+
20+
steps:
21+
- name: setup xcode
22+
uses: maxim-lobanov/setup-xcode@v1
23+
with:
24+
xcode-version: '14.1'
25+
- name: Checkout OneSignal-iOS-SDK
26+
uses: actions/checkout@v4
27+
with:
28+
ref: ${{env.release_branch}}
29+
30+
- name: Install the Apple certificate and provisioning profile
31+
uses: apple-actions/import-codesign-certs@v2
32+
with:
33+
p12-file-base64: ${{ secrets.CERTIFICATES_P12 }}
34+
p12-password: ${{ secrets.CERTIFICATES_P12_PASSWORD }}
35+
# - name: Bump Version Number
36+
# run: |
37+
- name: Build Binaries
38+
run: |
39+
cd iOS_SDK/OneSignalSDK
40+
chmod +x ./build_all_frameworks.sh
41+
./build_all_frameworks.sh
42+
shell: bash
43+
- name: Update Swift Package
44+
run: |
45+
cd iOS_SDK/OneSignalSDK
46+
chmod +x ./update_swift_package.sh
47+
./update_swift_package.sh ${{env.version}}
48+
shell: bash
49+
- name: Commit Changes
50+
run: |
51+
git config --local user.email "[email protected]"
52+
git config --local user.name "SyncR 🤖"
53+
git add .
54+
git commit -m "Release ${{env.version}}"
55+
56+
- name: Pushing changes
57+
uses: ad-m/github-push-action@master
58+
with:
59+
github_token: ${{ secrets.GITHUB_TOKEN }}
60+
repository: 'OneSignal/OneSignal-iOS-SDK'
61+
force: true
62+
branch: ${{env.release_branch}}
63+
64+
- name: "Submitting PR"
65+
uses: octokit/[email protected]
66+
with:
67+
route: POST /repos/{owner}/{repo}/pulls
68+
owner: OneSignal
69+
repo: OneSignal-iOS-SDK
70+
head: ${{env.release_branch}}
71+
base: main
72+
title: |
73+
"Release ${{env.version}}"
74+
body: |
75+
"Add Release Notes For Review Here"
76+
env:
77+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

iOS_SDK/OneSignalSDK/build_all_frameworks.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ create_xcframework() {
2424
echo "Created ${FRAMEWORK_FOLDER_NAME}"
2525
echo "Archiving ${FRAMEWORK_NAME}"
2626

27+
xcodebuild -list
28+
2729
xcodebuild archive ONLY_ACTIVE_ARCH=NO -scheme ${BUILD_SCHEME} -destination="generic/platform=iOS Simulator" -archivePath "${SIMULATOR_ARCHIVE_PATH}" -sdk iphonesimulator SKIP_INSTALL=NO BUILD_LIBRARIES_FOR_DISTRIBUTION=YES
2830

2931
xcodebuild archive -scheme ${BUILD_SCHEME} -destination="generic/platform=iOS" -archivePath "${IOS_DEVICE_ARCHIVE_PATH}" -sdk iphoneos SKIP_INSTALL=NO BUILD_LIBRARIES_FOR_DISTRIBUTION=YES

iOS_SDK/OneSignalSDK/update_swift_package.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ set -e
44
WORKING_DIR=$(pwd)
55

66
#Ask for the new release version number to be placed in the package URL
7-
echo -e "\033[1mEnter the new SDK release version number\033[0m"
8-
read VERSION_NUMBER
7+
# echo -e "\033[1mEnter the new SDK release version number\033[0m"
8+
# read VERSION_NUMBER
9+
VERSION_NUMBER=$1
910

1011
update_framework() {
1112
FRAMEWORK_FOLDER_NAME=$1

0 commit comments

Comments
 (0)