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

Dev/delivery 63802/ci modification #141

Merged
merged 24 commits into from
Jun 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .github/bash_scripts/pre_release.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
#!/bin/bash

appsflyerLibVersion=$1
rcVersion=$2

sed -i '' "s/version_appsflyerLib = \'.*\'/version_appsflyerLib = \'$appsflyerLibVersion\'/g" segment-appsflyer-ios.podspec
sed -i '' "s/version_plugin = \'.*\'/version_plugin = \'$rcVersion\'/g" segment-appsflyer-ios.podspec
sed -i '' "s/s.name = \"segment-appsflyer-ios\"/s.name = \"segment-appsflyer-ios-qa\"/g" segment-appsflyer-ios.podspec
mv segment-appsflyer-ios.podspec segment-appsflyer-ios-qa.podspec

sed -r -i '' "s/(.*AppsFlyerLib.*)([0-9]+\.[0-9]+\.[0-9]+)(.*)/\1$appsflyerLibVersion\3/g" Package.swift

sed -r -i '' "s/(.*pod \'segment-appsflyer-ios\')(.*\'[0-9]+\.[0-9]+\.[0-9]+\')/\1,:podspec => \'\.\.\/\.\.\/segment-appsflyer-ios.podspec\'/g" examples/SwiftPodsSample/Podfile
sed -r -i '' "s/(.*pod \'segment-appsflyer-ios\')(.*\'[0-9]+\.[0-9]+\.[0-9]+\')/\1,:podspec => \'\.\.\/\.\.\/segment-appsflyer-ios.podspec\'/g" examples/ObjcPodsSample/Podfile
sed -r -i '' "s/(.*pod \'segment-appsflyer-ios)\'(.*\'[0-9]+\.[0-9]+\.[0-9]+\')/\1\',\'$rcVersion\'/g" examples/SwiftPodsSample/Podfile
sed -r -i '' "s/(.*pod \'segment-appsflyer-ios)\'(.*\'[0-9]+\.[0-9]+\.[0-9]+\')/\1\',\'$rcVersion\'/g" examples/ObjcPodsSample/Podfile

sed -r -i '' "s/(## This is a Segment wrapper for AppsFlyer SDK that is built with iOS SDK v)(.*)/\1$appsflyerLibVersion./g" README.md
sed -r -i '' "s/(.*pod \'segment-appsflyer-ios.*)([0-9]+\.[0-9]+\.[0-9]+)(.*)/\1$appsflyerLibVersion\3/g" README.md
Expand Down
8 changes: 5 additions & 3 deletions .github/bash_scripts/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@

releaseVersion=$1

sed -r -i '' "s/version_plugin = \'[0-9]+\.[0-9]+\.[0-9]+\'/version_plugin = \'$releaseVersion\'/g" segment-appsflyer-ios.podspec
sed -r -i '' "s/version_plugin = \'[0-9]+\.[0-9]+\.[0-9]+.*\'/version_plugin = \'$releaseVersion\'/g" segment-appsflyer-ios-qa.podspec
sed -i '' "s/s.name = \"segment-appsflyer-ios-qa\"/s.name = \"segment-appsflyer-ios\"/g" segment-appsflyer-ios-qa.podspec
mv segment-appsflyer-ios-qa.podspec segment-appsflyer-ios.podspec

sed -r -i '' "s/(.*pod \'segment-appsflyer-ios\')(.*)/\1,\'$releaseVersion\'/g" examples/SwiftPodsSample/Podfile
sed -r -i '' "s/(.*pod \'segment-appsflyer-ios\')(.*)/\1,\'$releaseVersion\'/g" examples/ObjcPodsSample/Podfile
sed -r -i '' "s/(.*pod \'segment-appsflyer-ios)-qa\'(.*)/\1\',\'$releaseVersion\'/g" examples/SwiftPodsSample/Podfile
sed -r -i '' "s/(.*pod \'segment-appsflyer-ios)-qa\'(.*)/\1\',\'$releaseVersion\'/g" examples/ObjcPodsSample/Podfile

sed -i '' 's/^/* /' "releasenotes.$releaseVersion"
NEW_VERSION_RELEASE_NOTES=$(cat "releasenotes.$releaseVersion")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,35 @@ on:
workflow_call:

jobs:
Change-HardCoded-Version:
Change-HardCoded-Version-And-Then-Release:
name: Pre Release
runs-on: macos-latest
runs-on: [ios, self-hosted]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Determine release tag and release branch
run: |
echo ${{github.ref_name}}
TAG=$(echo "${{github.ref_name}}" | grep -Eo '[0-9]+.[0-9]+.[0-9]+')
echo "PLUGIN_VERSION=$TAG" >> $GITHUB_ENV
echo "PLUGIN_VERSION=$TAG" >> $GITHUB_ENV
TAG_RC=$(echo "${{github.ref_name}}" | grep -Eo '[0-9]+.[0-9]+.[0-9]+-rc[0-9]+')
echo "PLUGIN_VERSION_RC=$TAG_RC" >> $GITHUB_ENV

- name: run script
run: bash .github/bash_scripts/pre_release.sh ${{env.PLUGIN_VERSION}}
run: bash .github/bash_scripts/pre_release.sh ${{env.PLUGIN_VERSION}} ${{env.PLUGIN_VERSION_RC}}
- name: Commit changes
uses: EndBug/add-and-commit@v9
with:
author_name: Moris Gateno
author_email: [email protected]
message: 'Commited from github action - prepaing the repo for QA locally.'
add: '.'
add: '.'
tag: "${{env.PLUGIN_VERSION_RC}} --force"
tag_push: '--force'
- name: Push to COCOAPODS
run: |
pod trunk me
pod trunk push segment-appsflyer-ios-qa.podspec



1 change: 0 additions & 1 deletion .github/workflows/prepare-for-release-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ on:
- opened
branches:
- 'master'
# - 'dev/add-release-workflow'

jobs:
Prepare-Plugin-For-Production:
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/release-QA-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ jobs:
if: needs.Check-If-ReleaseNotes-Pushed.outputs.answer == 'false'
uses: ./.github/workflows/unit-tests-workflow.yml

Deploy-Locally-To-QA:
needs: [Run-Unit-Tests,Check-If-ReleaseNotes-Pushed]
Prepere-To-QA-&-Release:
needs: [Check-If-ReleaseNotes-Pushed]
if: needs.Check-If-ReleaseNotes-Pushed.outputs.answer == 'false'
uses: ./.github/workflows/prepare-for-QA-release.yml
uses: ./.github/workflows/prepare-for-QA-&-release.yml

8 changes: 4 additions & 4 deletions .github/workflows/release-production-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
jobs:
Deploy-To-Production:
if: github.event.pull_request.merged == true && startsWith(github.head_ref, 'releases/')
runs-on: macos-latest
runs-on: [ios, self-hosted]
steps:
- name: Checkout
uses: actions/checkout@v3
Expand Down Expand Up @@ -49,9 +49,9 @@ jobs:
- name: Install Cocoapods
run: gem install cocoapods
- name: Push to COCOAPODS
uses: michaelhenry/[email protected]
env:
COCOAPODS_TRUNK_TOKEN: ${{ secrets.CI_COCOAPODS_TOKEN }}
run: |
pod trunk me
pod trunk push segment-appsflyer-ios.podspec
- name: Notify with SLack
uses: slackapi/[email protected]
with:
Expand Down
Loading