Skip to content

Commit

Permalink
Merge branch 'feature/MBX-3346-MindboxLoggerCI' into feature/MBX-0000…
Browse files Browse the repository at this point in the history
…-TestMBLoggerCI
  • Loading branch information
Vailence authored May 20, 2024
2 parents 5ae0828 + 20a8602 commit 8de3385
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 79 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/prepare_logger_branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
uses: actions/checkout@v4

- name: Extract version from branch name
run: echo "VERSION=${GITHUB_REF#refs/heads/test-logger-release/}" >> $GITHUB_ENV
run: echo "VERSION=${GITHUB_REF#refs/heads/logger-release/}" >> $GITHUB_ENV

- name: Bump version
run: ./git-logger-release-branch-create.sh "${{ env.VERSION }}"
Expand Down
105 changes: 33 additions & 72 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,76 +10,37 @@ on:
- '**'

jobs:
unit:
runs-on: macos-14
steps:
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # 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
run: |
set -eo pipefail
pod lib lint --allow-warnings
exit 0
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 - MindboxLogger release",
"blocks": [
{
"type": "header",
"text": {
"type": "plain_text",
"text": "🚀 MindboxLogger tested."
}
}
]
}
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_MOBILE_NOTIFIER_TOKEN }}

publish:
needs: [logger-publish]
if: always()
runs-on: macos-14
steps:
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # 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
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
10 changes: 5 additions & 5 deletions git-logger-release-branch-create.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ if ! [[ $1 =~ ^[0-9]+\.[0-9]+\.[0-9]+(-rc)?$ ]]; then
exit 1
fi

version=$1
version="$1-logger" # Add logger- prefix to version

# Update version in MindboxLogger.podspec
logger_podspec_file="MindboxLogger.podspec"
sed -i '' "s/^\([[:space:]]*spec.version[[:space:]]*=[[:space:]]*'logger-\).*\('\)$/\1$version\2/" "$logger_podspec_file"
echo "$logger_podspec_file version updated to logger-$version."
sed -i '' "s/^\([[:space:]]*spec.version[[:space:]]*=[[:space:]]*'\).*\('\)$/\1$version\2/" "$logger_podspec_file"
echo "$logger_podspec_file version updated to $version."

# Update dependency version in Mindbox.podspec
podspec_file="Mindbox.podspec"
Expand All @@ -29,14 +29,14 @@ notification_podspec_file="MindboxNotifications.podspec"
sed -i '' "s/\(spec.dependency 'MindboxLogger', '\)[^']*\(\'\)/\1$version\2/g" "$notification_podspec_file"
echo "$notification_podspec_file dependency on MindboxLogger updated to $version."


git add $logger_podspec_file $podspec_file $notification_podspec_file
git commit -m "Update MindboxLogger and dependencies to version $version"
git push origin HEAD
echo "Version update completed and pushed to repository."

tag="logger-$version"
tag=$version
git tag $tag
git push origin $tag

echo "Tag $tag pushed to repository."

0 comments on commit 8de3385

Please sign in to comment.