Skip to content

Commit

Permalink
Merge branch 'main' of github.com:customerio/customerio-ios into shah…
Browse files Browse the repository at this point in the history
…roz-old-token-fix
  • Loading branch information
Shahroz16 committed May 3, 2023
2 parents ef7510a + 0946a76 commit 1a5bffb
Show file tree
Hide file tree
Showing 19 changed files with 240 additions and 158 deletions.
121 changes: 0 additions & 121 deletions .github/workflows/deploy-cocoapods.yml

This file was deleted.

121 changes: 121 additions & 0 deletions .github/workflows/deploy-sdk.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
name: Deploy SDK

on:
workflow_dispatch: # manually run this workflow. This allows you to manually deploy things like cococapods, not manually create a git tag. The tag needs to already be created to run this.
inputs:
existing-git-tag:
description: 'Type name of existing git tag (example: 1.0.3) to checkout and manually deploy'
required: true
type: string

push:
branches: [beta, main, v1] # all branches where deployments currently occur. Make sure this list matches list of branches in `.releaserc` file.

Expand All @@ -14,6 +21,7 @@ jobs:
name: Deploy git tag
runs-on: ubuntu-latest
outputs:
new_release_git_head: ${{ steps.semantic-release.outputs.new_release_git_head }}
new_release_published: ${{ steps.semantic-release.outputs.new_release_published }}
new_release_version: ${{ steps.semantic-release.outputs.new_release_version }}
steps:
Expand Down Expand Up @@ -116,4 +124,117 @@ jobs:
# Help on how to get the webhook URL: https://github.com/marketplace/actions/slack-send#setup-2
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_NOTIFY_RELEASES_WEBHOOK_URL }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK

deploy-cocoapods:
name: Deploy SDK to Cocoapods
needs: [deploy-git-tag] # run after git tag is made
# Only run if we can find a git tag to checkout.
if: ${{ needs.deploy-git-tag.outputs.new_release_published == 'true' || github.event_name == 'workflow_dispatch' }}
env:
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}
runs-on: macos-12
steps:
- name: Checkout git tag that got created in previous step
uses: actions/checkout@v3
if: needs.deploy-git-tag.outputs.new_release_git_head != ''
with:
ref: ${{ needs.deploy-git-tag.outputs.new_release_git_head }}

- name: Checkout git tag that was previously created
uses: actions/checkout@v3
if: inputs.existing-git-tag != ''
with:
ref: ${{ inputs.existing-git-tag }}

- name: Install cocoapods
run: gem install cocoapods
- name: '⚠️ Note: Pushing to cocoapods is flaky. If you see some errors in these logs while deploying, re-run this GitHub Action to try deployment again and it might fix the issue.'
run: echo ''
- name: Push CustomerIOCommon
run: ./scripts/push-cocoapod.sh CustomerIOCommon.podspec
- name: Push CustomerIOTracking
run: ./scripts/push-cocoapod.sh CustomerIOTracking.podspec
- name: Push CustomerIOMessagingPush
run: ./scripts/push-cocoapod.sh CustomerIOMessagingPush.podspec
- name: Push CustomerIOMessagingPushAPN
run: ./scripts/push-cocoapod.sh CustomerIOMessagingPushAPN.podspec
- name: Push CustomerIOMessagingPushFCM
run: ./scripts/push-cocoapod.sh CustomerIOMessagingPushFCM.podspec
- name: Push CustomerIOMessagingInApp
run: ./scripts/push-cocoapod.sh CustomerIOMessagingInApp.podspec
- name: Push CustomerIO
run: ./scripts/push-cocoapod.sh CustomerIO.podspec

- name: Notify team of successful deployment
uses: slackapi/slack-github-action@v1.18.0
if: ${{ success() }}
with:
# Use block kit for format of the JSON payloads: https://app.slack.com/block-kit-builder
payload: |
{
"text": "iOS SDK deployed to CocoaPods",
"username": "iOS deployment bot",
"icon_url": "https://pngimg.com/uploads/apple_logo/apple_logo_PNG19687.png",
"channel": "#mobile-deployments",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*iOS* SDK deployed to Cocoapods! (deployment step 2 of 2)"
}
},
{
"type": "divider"
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*Version ${{ github.event.release.tag_name }}*\n\niOS SDK deployment progress:\n ~1. <https://github.com/${{github.repository}}/releases/tag/${{ github.event.release.tag_name }}|create git tag and deploy to Swift Package Manager>~\n~2. deploy to cocoapods~\n\nBecause it's hard to automatically verify cocoapods get deployed, it's recommended to manually verify if cocoapods got deployed successfully by checking for cococapods emails or https://github.com/cocoaPods/specs to see if new commit was added for the release."
}
}
]
}
env:
# Incoming webhook URL that sends message into the correct Slack channel.
# Help on how to get the webhook URL: https://github.com/marketplace/actions/slack-send#setup-2
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_NOTIFY_RELEASES_WEBHOOK_URL }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK

- name: Notify team of failure
uses: slackapi/slack-github-action@v1.18.0
if: ${{ failure() }} # only run this if any previous step failed
with:
# Use block kit for format of the JSON payloads: https://app.slack.com/block-kit-builder
payload: |
{
"text": "iOS SDK deployment failure",
"username": "iOS deployment bot",
"icon_url": "https://pngimg.com/uploads/apple_logo/apple_logo_PNG19687.png",
"channel": "#mobile-deployments",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*iOS* SDK deployment :warning: failure :warning:"
}
},
{
"type": "divider"
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "iOS SDK failed deployment during step *deploy to cocoapods*. View <https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}|CI server logs> to learn why and fix the issue. <https://github.com/customerio/mobile/blob/main/GIT-WORKFLOW.md|Learn more about the deployment process and how to fix errors>."
}
}
]
}
env:
# Incoming webhook URL that sends message into the correct Slack channel.
# Help on how to get the webhook URL: https://github.com/marketplace/actions/slack-send#setup-2
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_NOTIFY_RELEASES_WEBHOOK_URL }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
5 changes: 1 addition & 4 deletions .github/workflows/pr-helper.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,4 @@ jobs:
- name: Semantic PR helper
uses: levibostian/action-semantic-pr@v3
with:
readToken: ${{ secrets.GITHUB_TOKEN }}
# Sets rules on the types of commits allowed on a specific branch.
# Example: {"beta": "fix,docs"} gives a warning on the pull request if a pull request is made into the beta branch with a type thats not fix.
branchTypeWarning: '{"beta": "fix", "main": "fix"}'
readToken: ${{ secrets.GITHUB_TOKEN }}
2 changes: 2 additions & 0 deletions Apps/CocoaPods-FCM/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ sdk_local_path = File.join(File.dirname(__FILE__), '../../')

target 'test cocoapods' do
pod 'CustomerIOCommon', :path => sdk_local_path
pod 'CustomerIOTracking', :path => sdk_local_path
pod 'CustomerIOMessagingPush', :path => sdk_local_path
pod 'CustomerIOMessagingPushFCM', :path => sdk_local_path
pod 'CustomerIOMessagingInApp', :path => sdk_local_path
Expand All @@ -15,6 +16,7 @@ end

target 'Rich Push Notification Service Extension' do
pod 'CustomerIOCommon', :path => sdk_local_path
pod 'CustomerIOTracking', :path => sdk_local_path
pod 'CustomerIOMessagingPush', :path => sdk_local_path
pod 'CustomerIOMessagingPushFCM', :path => sdk_local_path
end
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
## [2.5.0](https://github.com/customerio/customerio-ios/compare/2.4.1...2.5.0) (2023-04-27)


### Features

* expose current SDK config options for reference ([#298](https://github.com/customerio/customerio-ios/issues/298)) ([6ac739b](https://github.com/customerio/customerio-ios/commit/6ac739b1550636db10230d8b2c10783f46626250))

### [2.4.1](https://github.com/customerio/customerio-ios/compare/2.4.0...2.4.1) (2023-04-27)


### Bug Fixes

* auto update gist in CocoaPods ([#303](https://github.com/customerio/customerio-ios/issues/303)) ([6096d17](https://github.com/customerio/customerio-ios/commit/6096d176cdc52e7e8a949960bfb9c4aa1541c8fd))

## [2.4.0](https://github.com/customerio/customerio-ios/compare/2.3.0...2.4.0) (2023-04-27)


### Features

* get the version of the SDK ([#299](https://github.com/customerio/customerio-ios/issues/299)) ([38a6b00](https://github.com/customerio/customerio-ios/commit/38a6b0061f0f5b317f592ec885f8746c65ab8ba5))

## [2.3.0](https://github.com/customerio/customerio-ios/compare/2.2.0...2.3.0) (2023-04-19)


Expand Down
2 changes: 1 addition & 1 deletion CustomerIO.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

Pod::Spec.new do |spec|
spec.name = "CustomerIO"
spec.version = "2.3.0" # Don't modify this line - it's automatically updated
spec.version = "2.5.0" # Don't modify this line - it's automatically updated
spec.summary = "Official Customer.io SDK for iOS."
spec.homepage = "https://github.com/customerio/customerio-ios"
spec.documentation_url = 'https://customer.io/docs/sdk/ios/'
Expand Down
2 changes: 1 addition & 1 deletion CustomerIOCommon.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |spec|
spec.name = "CustomerIOCommon"
spec.version = "2.3.0" # Don't modify this line - it's automatically updated
spec.version = "2.5.0" # Don't modify this line - it's automatically updated
spec.summary = "Official Customer.io SDK for iOS."
spec.homepage = "https://github.com/customerio/customerio-ios"
spec.documentation_url = 'https://customer.io/docs/sdk/ios/'
Expand Down
4 changes: 2 additions & 2 deletions CustomerIOMessagingInApp.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |spec|
spec.name = "CustomerIOMessagingInApp"
spec.version = "2.3.0" # Don't modify this line - it's automatically updated
spec.version = "2.5.0" # Don't modify this line - it's automatically updated
spec.summary = "Official Customer.io SDK for iOS."
spec.homepage = "https://github.com/customerio/customerio-ios"
spec.documentation_url = 'https://customer.io/docs/sdk/ios/'
Expand All @@ -21,5 +21,5 @@ Pod::Spec.new do |spec|
spec.module_name = "CioMessagingInApp" # the `import X` name when using SDK in Swift files

spec.dependency "CustomerIOTracking", "= #{spec.version.to_s}"
spec.dependency "Gist", '~> 3.0.4'
spec.dependency "Gist", '~> 3'
end
2 changes: 1 addition & 1 deletion CustomerIOMessagingPush.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |spec|
spec.name = "CustomerIOMessagingPush"
spec.version = "2.3.0" # Don't modify this line - it's automatically updated
spec.version = "2.5.0" # Don't modify this line - it's automatically updated
spec.summary = "Official Customer.io SDK for iOS."
spec.homepage = "https://github.com/customerio/customerio-ios"
spec.documentation_url = 'https://customer.io/docs/sdk/ios/'
Expand Down
2 changes: 1 addition & 1 deletion CustomerIOMessagingPushAPN.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |spec|
spec.name = "CustomerIOMessagingPushAPN"
spec.version = "2.3.0" # Don't modify this line - it's automatically updated
spec.version = "2.5.0" # Don't modify this line - it's automatically updated
spec.summary = "Official Customer.io SDK for iOS."
spec.homepage = "https://github.com/customerio/customerio-ios"
spec.documentation_url = 'https://customer.io/docs/sdk/ios/'
Expand Down
2 changes: 1 addition & 1 deletion CustomerIOMessagingPushFCM.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |spec|
spec.name = "CustomerIOMessagingPushFCM"
spec.version = "2.3.0" # Don't modify this line - it's automatically updated
spec.version = "2.5.0" # Don't modify this line - it's automatically updated
spec.summary = "Official Customer.io SDK for iOS."
spec.homepage = "https://github.com/customerio/customerio-ios"
spec.documentation_url = 'https://customer.io/docs/sdk/ios/'
Expand Down
2 changes: 1 addition & 1 deletion CustomerIOTracking.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |spec|
spec.name = "CustomerIOTracking"
spec.version = "2.3.0" # Don't modify this line - it's automatically updated
spec.version = "2.5.0" # Don't modify this line - it's automatically updated
spec.summary = "Official Customer.io SDK for iOS."
spec.homepage = "https://github.com/customerio/customerio-ios"
spec.documentation_url = 'https://customer.io/docs/sdk/ios/'
Expand Down
2 changes: 1 addition & 1 deletion Sources/Common/Version.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ import Foundation
Keep this file as small as possible to make the automated updating script stable and easy to use.
*/
public enum SdkVersion {
public static let version: String = "2.3.0"
public static let version: String = "2.5.0"
}

0 comments on commit 1a5bffb

Please sign in to comment.