Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add release workflow github action #1340

Merged
merged 12 commits into from
Feb 2, 2024
77 changes: 77 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: iOS CD

on:
workflow_dispatch:
inputs:
version:
type: string
description: "The version number of the release"
required: true
release_branch:
type: string
description: "The release branch with bumped version numbers for the release"
required: true

jobs:
build:
name: Build the binaries for the release and create a PR
runs-on: macos-13

steps:
- name: setup xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '14.1'
- name: Checkout OneSignal-iOS-SDK
uses: actions/checkout@v4
with:
ref: ${{env.release_branch}}

- name: Install the Apple certificate and provisioning profile
uses: apple-actions/import-codesign-certs@v2
with:
p12-file-base64: ${{ secrets.CERTIFICATES_P12 }}
p12-password: ${{ secrets.CERTIFICATES_P12_PASSWORD }}
# - name: Bump Version Number
# run: |
- name: Build Binaries
run: |
cd iOS_SDK/OneSignalSDK
chmod +x ./build_all_frameworks.sh
./build_all_frameworks.sh
shell: bash
- name: Update Swift Package
run: |
cd iOS_SDK/OneSignalSDK
chmod +x ./update_swift_package.sh
./update_swift_package.sh ${{env.version}}
shell: bash
- name: Commit Changes
run: |
git config --local user.email "[email protected]"
git config --local user.name "SyncR 🤖"
git add .
git commit -m "Release ${{env.version}}"

- name: Pushing changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
repository: 'OneSignal/OneSignal-iOS-SDK'
force: true
branch: ${{env.release_branch}}

- name: "Submitting PR"
uses: octokit/[email protected]
with:
route: POST /repos/{owner}/{repo}/pulls
owner: OneSignal
repo: OneSignal-iOS-SDK
head: ${{env.release_branch}}
base: main
title: |
"Release ${{env.version}}"
body: |
"Add Release Notes For Review Here"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 2 additions & 0 deletions iOS_SDK/OneSignalSDK/build_all_frameworks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ create_xcframework() {
echo "Created ${FRAMEWORK_FOLDER_NAME}"
echo "Archiving ${FRAMEWORK_NAME}"

xcodebuild -list

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

xcodebuild archive -scheme ${BUILD_SCHEME} -destination="generic/platform=iOS" -archivePath "${IOS_DEVICE_ARCHIVE_PATH}" -sdk iphoneos SKIP_INSTALL=NO BUILD_LIBRARIES_FOR_DISTRIBUTION=YES
Expand Down
5 changes: 3 additions & 2 deletions iOS_SDK/OneSignalSDK/update_swift_package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ set -e
WORKING_DIR=$(pwd)

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

update_framework() {
FRAMEWORK_FOLDER_NAME=$1
Expand Down
Loading