Skip to content

Commit

Permalink
Merge pull request #425 from mindbox-cloud/release/2.10.3-rc
Browse files Browse the repository at this point in the history
Release/2.10.3-rc
  • Loading branch information
AndreyEmtsov authored Jul 26, 2024
2 parents a6c2472 + 8687d61 commit 1ca5c46
Show file tree
Hide file tree
Showing 11 changed files with 169 additions and 141 deletions.
5 changes: 0 additions & 5 deletions .github/git-release-branch-create.sh
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,3 @@ if ! git push origin $current_branch; then
echo "Failed to push changes to the origin $current_branch"
exit 1
fi

git tag $version
git push origin $version

echo "Changes have been committed and tagged as $version on branch $current_branch."
55 changes: 12 additions & 43 deletions .github/workflows/prepare_release_branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,48 +41,17 @@ jobs:
echo "PR_URL=$PR_URL" >> $GITHUB_ENV
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}


- name: Post to a Slack channel
id: slack
uses: slackapi/[email protected]
with:
channel-id: 'C06RXV161RA'
payload: |
{
"text": "iOS Release Branch Notification",
"blocks": [
{
"type": "header",
"text": {
"type": "plain_text",
"text": "🚀 iOS Release Branch Created"
}
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*Branch Name:* *`release/${{ env.VERSION }}`*\n*Status:* Success :white_check_mark:"
}
},
{
"type": "divider"
},
{
"type": "actions",
"elements": [
{
"type": "button",
"text": {
"type": "plain_text",
"text": "Pull Request"
},
"url": "${{ env.PR_URL }}"
}
]
}
]
}
- name: Send message to LOOP
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_MOBILE_NOTIFIER_TOKEN }}
LOOP_NOTIFICATION_WEBHOOK_URL: ${{ secrets.LOOP_NOTIFICATION_WEBHOOK_URL }}
VERSION: ${{ github.ref_name }}
run: |
MESSAGE=$(cat <<EOF
{
"text": "**🚀 iOS Release Branch Created**\n\n*Branch Name:* \`release/$VERSION\`\n*Build number:* $BUILD_NUMBER"
}
EOF)
curl -X POST "$LOOP_NOTIFICATION_WEBHOOK_URL" \
-H "Content-Type: application/json" \
-d "$MESSAGE"
206 changes: 130 additions & 76 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
- '**'

jobs:
unit:
unit-tests:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -20,18 +20,29 @@ jobs:
run: gem install bundler
- name: Install bundler dependencies
run: bundle install
- name: Install yeetd
run: |
wget https://github.com/biscuitehh/yeetd/releases/download/1.0/yeetd-normal.pkg
sudo installer -pkg yeetd-normal.pkg -target /
yeetd &
- name: Run unit tests
run: bundle exec fastlane unitTestLane

set-tag:
needs: [unit-tests]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Extract SDK version
run: |
SDK_VERSION=$(sed -n 's/^.*sdkVersion = "\(.*\)"/\1/p' SDKVersionProvider/SDKVersionProvider.swift)
echo "SDK_VERSION=$SDK_VERSION" >> $GITHUB_ENV
echo "Extracted SDK version: $SDK_VERSION"
- name: Create tag
run: |
git tag ${{ env.SDK_VERSION }}
git push origin ${{ env.SDK_VERSION }}
logger-publish:
needs: [set-tag]
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4
- name: Update bundler
run: gem install bundler
- name: Install bundler dependencies
Expand All @@ -42,83 +53,126 @@ jobs:
pod trunk push MindboxLogger.podspec --allow-warnings
env:
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TOKEN }}
- name: Post to a Slack channel
id: slack
uses: slackapi/[email protected]

delay:
needs: [logger-publish]
runs-on: ubuntu-latest
steps:
- name: Delay for 20 minutes
run: sleep 1200

check-podspecs-with-retry:
needs: [delay]
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Update bundler
run: gem install bundler
- name: Install bundler dependencies
run: bundle install
- uses: nick-fields/retry@v3
with:
channel-id: 'C06RXV161RA'
payload: |
{
"text": "iOS - release",
"blocks": [
{
"type": "header",
"text": {
"type": "plain_text",
"text": "🚀 MindboxLogger has been successfuly released."
}
}
]
}
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_MOBILE_NOTIFIER_TOKEN }}
timeout_minutes: 5
max_attempts: 20
command: |
pod repo update
pod lib lint --allow-warnings
retry_on: error
retry_wait_seconds: 120

publish:
needs: [logger-publish]
needs: [check-podspecs-with-retry]
runs-on: macos-latest
steps:
- name: Delay for 5 minutes
run: sleep 300
- uses: actions/checkout@v4
- uses: actions/checkout@v4
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable

- name: Release generation
run: ./.github/git-release.sh
env:
GH_TOKEN: ${{ github.token }}

- name: Update bundler
run: gem install bundler
- name: Install bundler dependencies
run: bundle install
- name: Install yeetd
run: |
wget https://github.com/biscuitehh/yeetd/releases/download/1.0/yeetd-normal.pkg
sudo installer -pkg yeetd-normal.pkg -target /
yeetd &
- uses: actions/checkout@v4
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
- name: Update bundler
run: gem install bundler
- name: Install bundler dependencies
run: bundle install
- name: Run build
run: bundle exec fastlane buildLane
env:
CI: true
- name: Deploy to Cocoapods Mindbox/MindboxNotifications
run: |
pod repo update
set -eo pipefail
pod lib lint --allow-warnings
pod trunk push Mindbox.podspec --allow-warnings
pod trunk push MindboxNotifications.podspec --allow-warnings
env:
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TOKEN }}

- name: Run build
run: bundle exec fastlane buildLane
env:
CI: true
- name: Deploy to Cocoapods Mindbox/MindboxNotifications
run: |
pod repo update
set -eo pipefail
pod lib lint --allow-warnings
pod trunk push Mindbox.podspec --allow-warnings
pod trunk push MindboxNotifications.podspec --allow-warnings
env:
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TOKEN }}
release-github:
needs: [publish]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Release generation
run: ./.github/git-release.sh
env:
GH_TOKEN: ${{ github.token }}

merge:
needs: [publish]
runs-on: ubuntu-latest
steps:
- name: Checkout develop branch
uses: actions/checkout@v4
with:
ref: develop
- name: Create Pull Request
run: gh pr create --base develop --head master --title "Merge 'master' into 'develop' after release" --body "Automated Pull Request to merge 'master' into 'develop' after release"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Merge Pull Request
run: |
pr_number=$(gh pr list --base develop --head master --json number --jq '.[0].number')
gh pr merge $pr_number --merge
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout develop branch
uses: actions/checkout@v4
with:
ref: develop
- name: Create Pull Request
run: gh pr create --base develop --head master --title "Merge 'master' into 'develop' after release" --body "Automated Pull Request to merge 'master' into 'develop' after release"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Merge Pull Request
run: |
pr_number=$(gh pr list --base develop --head master --json number --jq '.[0].number')
gh pr merge $pr_number --merge
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

notify-on-error:
needs: [unit-tests, set-tag, logger-publish, delay, check-podspecs-with-retry, publish, release-github, merge]
runs-on: ubuntu-latest
if: ${{ failure() }}
steps:
- name: Determine failed job
id: get-failed-job
run: |
FAILED_JOB="None"
if [[ "${{ needs.unit-tests.result }}" == "failure" ]]; then
FAILED_JOB="unit-tests"
elif [[ "${{ needs.set-tag.result }}" == "failure" ]]; then
FAILED_JOB="set-tag"
elif [[ "${{ needs.logger-publish.result }}" == "failure" ]]; then
FAILED_JOB="logger-publish"
elif [[ "${{ needs.delay.result }}" == "failure" ]]; then
FAILED_JOB="delay"
elif [[ "${{ needs.check-podspecs-with-retry.result }}" == "failure" ]]; then
FAILED_JOB="check-podspecs-with-retry"
elif [[ "${{ needs.publish.result }}" == "failure" ]]; then
FAILED_JOB="publish"
elif [[ "${{ needs.release-github.result }}" == "failure" ]]; then
FAILED_JOB="release-github"
elif [[ "${{ needs.merge.result }}" == "failure" ]]; then
FAILED_JOB="merge"
fi
echo "FAILED_JOB=$FAILED_JOB" >> $GITHUB_ENV
- name: Send message to LOOP
env:
LOOP_NOTIFICATION_WEBHOOK_URL: ${{ secrets.LOOP_NOTIFICATION_WEBHOOK_URL }}
VERSION: ${{ github.ref_name }}
FAILED_JOB: ${{ env.FAILED_JOB }}
run: |
MESSAGE=$(cat <<EOF
{
"text": "**❌ iOS test Release failed**\n\nJob \"$FAILED_JOB\" failed in the pipeline\nSomething went wrong"
}
EOF)
curl -X POST "$LOOP_NOTIFICATION_WEBHOOK_URL" \
-H "Content-Type: application/json" \
-d "$MESSAGE"
6 changes: 3 additions & 3 deletions Example/Podfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
use_frameworks!

target 'Example' do
pod 'Mindbox', '2.10.2'
pod 'Mindbox', '2.10.3-rc'
end

target 'MindboxNotificationServiceExtension' do
pod 'MindboxNotifications', '2.10.2'
pod 'MindboxNotifications', '2.10.3-rc'
end

target 'MindboxNotificationContentExtension' do
pod 'MindboxNotifications', '2.10.2'
pod 'MindboxNotifications', '2.10.3-rc'
end
4 changes: 2 additions & 2 deletions Mindbox.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |spec|
spec.name = "Mindbox"
spec.version = "2.10.2"
spec.version = "2.10.3-rc"
spec.summary = "SDK for integration with Mindbox"
spec.description = "This library allows you to integrate data transfer to Mindbox Marketing Cloud"
spec.homepage = "https://github.com/mindbox-cloud/ios-sdk"
Expand All @@ -14,6 +14,6 @@ Pod::Spec.new do |spec|
'Mindbox' => ['Mindbox/**/*.xcassets', 'Mindbox/**/*.xcdatamodeld', 'Mindbox/**/*.xcprivacy']
}
spec.swift_version = "5"
spec.dependency 'MindboxLogger', '2.10.2'
spec.dependency 'MindboxLogger', '2.10.3-rc'

end
2 changes: 1 addition & 1 deletion Mindbox/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
<key>CFBundleShortVersionString</key>
<string>$(MARKETING_VERSION)</string>
<key>CFBundleVersion</key>
<string>5614</string>
<string>5615</string>
</dict>
</plist>
2 changes: 1 addition & 1 deletion MindboxLogger.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |spec|
spec.name = "MindboxLogger"
spec.version = "2.10.2"
spec.version = "2.10.3-rc"
spec.summary = "SDK for utilities to work with Mindbox"
spec.description = "-"
spec.homepage = "https://github.com/mindbox-cloud/ios-sdk"
Expand Down
4 changes: 2 additions & 2 deletions MindboxNotifications.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |spec|
spec.name = "MindboxNotifications"
spec.version = "2.10.2"
spec.version = "2.10.3-rc"
spec.summary = "SDK for integration notifications with Mindbox"
spec.description = "This library allows you to integrate notifications and transfer them to Mindbox Marketing Cloud"
spec.homepage = "https://github.com/mindbox-cloud/ios-sdk"
Expand All @@ -14,6 +14,6 @@ Pod::Spec.new do |spec|
'MindboxNotifications' => ['MindboxNotifications/**/*.xcprivacy']
}
spec.swift_version = "5"
spec.dependency 'MindboxLogger', '2.10.2'
spec.dependency 'MindboxLogger', '2.10.3-rc'

end
Loading

0 comments on commit 1ca5c46

Please sign in to comment.