Skip to content

Commit

Permalink
MBX-0000 Test publish
Browse files Browse the repository at this point in the history
  • Loading branch information
Akylbek Utekeshev committed May 17, 2024
1 parent ff4a75a commit 20a8602
Show file tree
Hide file tree
Showing 2 changed files with 78 additions and 71 deletions.
147 changes: 77 additions & 70 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,90 +5,97 @@ on:
branches:
- 'master'
- 'support/*'
- 'feature/MBX-3346-MindboxLoggerCI'
tags-ignore:
- '**'

jobs:
unit:
runs-on: macos-14
steps:
- uses: actions/checkout@v4
- name: Update bundler
run: gem install bundler
- name: Install bundler dependencies
run: bundle install
- name: Run unit tests
run: bundle exec fastlane unitTestLane
# unit:
# runs-on: macos-14
# steps:
# - uses: actions/checkout@v4
# - name: Update bundler
# run: gem install bundler
# - name: Install bundler dependencies
# run: bundle install
# - name: Run unit tests
# run: bundle exec fastlane unitTestLane

logger-publish:
needs: [unit]
runs-on: macos-14
steps:
- uses: actions/checkout@v4
- name: Update bundler
run: gem install bundler
- name: Install bundler dependencies
run: bundle install
- name: Deploy to Cocoapods
- name: Deploy to Cocoapods MindboxLogger
run: |
set -eo pipefail
pod lib lint --allow-warnings
output=$(pod trunk push Mindbox.podspec --allow-warnings 2>&1)
echo "$output"
if echo "$output" | grep -q "Unable to accept duplicate entry for: MindboxLogger"; then
echo "Обнаружен дубликат версии, пропускаем публикацию."
exit 0
else
echo "Ошибка при публикации, требуется вмешательство."
echo "$output"
exit 1
fi
pod lib lint MindboxLogger.podspec --allow-warnings
pod trunk push MindboxLogger.podspec --allow-warnings 2>&1 || {
if [ $? -eq 0 ]; then
echo "Pushed to CocoaPods Trunk successfully."
elif pod trunk push MindboxLogger.podspec --allow-warnings 2>&1 | grep -q "[!] Unable to accept duplicate entry for: MindboxLogger (0.0.8)"; then
echo "Duplicate entry found, continuing as if successful."
else
echo "An error occurred."
exit 1
fi
}
# output=$(pod trunk push MindboxLogger.podspec --allow-warnings 2>&1)
# echo "$output"
# if echo "$output" | grep -q "Unable to accept duplicate entry for: MindboxLogger"; then
# echo "Обнаружен дубликат версии, пропускаем публикацию."
# exit 0
# else
# echo "Ошибка при публикации, требуется вмешательство."
# echo "$output"
# exit 1
# fi
env:
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TOKEN }}
- name: Post to a Slack channel
id: slack
uses: slackapi/[email protected]
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 }}
# - name: Post to a Slack channel
# id: slack
# uses: slackapi/[email protected]
# 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 }}

publish:
needs: [logger-publish]
runs-on: macos-14
steps:
- uses: actions/checkout@v4
- name: Release generation
run: ./git-release.sh "${{ github.event.head_commit.message }}" "${{secrets.GITHUBACCESSTOKEN}}" "${{secrets.GITHUBUSER}}"
- name: Update bundler
run: gem install bundler
- name: Install bundler dependencies
run: bundle install
- name: Select Xcode
run: sudo xcode-select --switch /Applications/Xcode_14.3.1.app
- name: Run build
run: bundle exec fastlane buildLane
env:
CI: true
- name: Deploy to Cocoapods
run: |
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 }}
# publish:
# needs: [logger-publish]
# runs-on: macos-14
# steps:
# - uses: actions/checkout@v4
# - name: Release generation
# run: ./git-release.sh "${{ github.event.head_commit.message }}" "${{secrets.GITHUBACCESSTOKEN}}" "${{secrets.GITHUBUSER}}"
# - name: Update bundler
# run: gem install bundler
# - name: Install bundler dependencies
# run: bundle install
# - name: Select Xcode
# run: sudo xcode-select --switch /Applications/Xcode_14.3.1.app
# - name: Run build
# run: bundle exec fastlane buildLane
# env:
# CI: true
# - name: Deploy to Cocoapods Mindbox/MindboxNotifications
# run: |
# set -eo pipefail
# pod lib lint --allow-warnings
# env:
# COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TOKEN }}
2 changes: 1 addition & 1 deletion MindboxLogger.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Pod::Spec.new do |spec|
spec.license = { :type => "CC BY-NC-ND 4.0", :file => "LICENSE" }
spec.author = { "Mindbox" => "[email protected]" }
spec.platform = :ios, "10.0"
spec.source = { :git => "https://github.com/mindbox-cloud/ios-sdk.git", :tag => "#{spec.version}-logger" }
spec.source = { :git => "https://github.com/mindbox-cloud/ios-sdk.git", :tag => "#{spec.version}" }
spec.source_files = "MindboxLogger/**/*.{swift}", "SDKVersionProvider/**/*.{swift}"
spec.exclude_files = "Classes/Exclude"
spec.resource_bundles = {
Expand Down

0 comments on commit 20a8602

Please sign in to comment.