-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from AppsFlyerSDK/dev/DELIVERY-63759/create-ci
Dev/delivery 63759/create ci
- Loading branch information
Showing
10 changed files
with
247 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/bash | ||
echo "# Uncomment the next line to define a global platform for your project | ||
# platform :ios, '9.0' | ||
target 'segment-appsflyer-ios' do | ||
# Comment the next line if you don't want to use dynamic frameworks | ||
use_frameworks! | ||
# Pods for segment-appsflyer-ios | ||
pod 'Analytics' | ||
pod 'AppsFlyerFramework' | ||
end | ||
target 'SegmentAppsFlyeriOSTests' do | ||
# Comment the next line if you don't want to use dynamic frameworks | ||
use_frameworks! | ||
# Pods for SegmentAppsFlyeriOSTests | ||
pod 'OCMock' | ||
end" > Podfile | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/bash | ||
|
||
appsflyerLibVersion=$1 | ||
rcVersion=$2 | ||
|
||
sed -i '' "s/version_appsflyerLib = \'.*\'/version_appsflyerLib = \'$appsflyerLibVersion\'/g" AppsFlyerAdobeAEPExtension.podspec | ||
sed -i '' "s/version_plugin = \'.*\'/version_plugin = \'$rcVersion\'/g" AppsFlyerAdobeAEPExtension.podspec | ||
sed -i '' "s/s.name = \'AppsFlyerAdobeAEPExtension\'/s.name = \'AppsFlyerAdobeAEPExtension-qa\'/g" AppsFlyerAdobeAEPExtension.podspec | ||
mv AppsFlyerAdobeAEPExtension.podspec AppsFlyerAdobeAEPExtension-qa.podspec | ||
|
||
sed -r -i '' "s/(.*AppsFlyerLib.*)([0-9]+\.[0-9]+\.[0-9]+)(.*)/\1$appsflyerLibVersion\3/g" Package.swift | ||
|
||
sed -r -i '' "s/(.*pod \'AppsFlyerAdobeAEPExtension)\'(.*\'[0-9]+\.[0-9]+\.[0-9]+\')/\1-qa\',\'$rcVersion\'/g" AdobeAEPSample/Podfile | ||
|
||
sed -r -i '' "s/(- iOS AppsFlyer SDK .*)([0-9]+\.[0-9]+\\.[0-9]+)(.*)/\1$appsflyerLibVersion\3/g" README.md | ||
|
||
sed -r -i '' "s/(.*EXTENSION_VERSION.*)([0-9]+\.[0-9]+\.[0-9]+)(.*)/\1$appsflyerLibVersion\3/g" AppsFlyerAdobeExtension/Sources/AppsFlyerConstants.swift | ||
|
||
touch "releasenotes.$appsflyerLibVersion" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/bash | ||
|
||
releaseVersion=$1 | ||
|
||
sed -r -i '' "s/version_plugin = \'[0-9]+\.[0-9]+\.[0-9]+.*\'/version_plugin = \'$releaseVersion\'/g" AppsFlyerAdobeAEPExtension-qa.podspec | ||
sed -i '' "s/s.name = \'AppsFlyerAdobeAEPExtension-qa\'/s.name = \'AppsFlyerAdobeAEPExtension\'/g" AppsFlyerAdobeAEPExtension-qa.podspec | ||
mv AppsFlyerAdobeAEPExtension-qa.podspec AppsFlyerAdobeAEPExtension.podspec | ||
|
||
sed -r -i '' "s/(.*pod \'AppsFlyerAdobeAEPExtension)-qa\'(.*)/\1\',\'$releaseVersion\'/g" AdobeAEPSample/Podfile | ||
|
||
sed -i '' 's/^/* /' "releasenotes.$releaseVersion" | ||
NEW_VERSION_RELEASE_NOTES=$(cat "releasenotes.$releaseVersion") | ||
NEW_VERSION_SECTION="### $releaseVersion\n$NEW_VERSION_RELEASE_NOTES\n\n" | ||
echo -e "$NEW_VERSION_SECTION$(cat RELEASENOTES.md)" > RELEASENOTES.md | ||
|
||
rm -r "releasenotes.$releaseVersion" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: pre-release | ||
|
||
on: | ||
workflow_call: | ||
|
||
jobs: | ||
Change-HardCoded-Version-And-Then-Release: | ||
name: Pre Release | ||
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 | ||
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}} ${{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: '.' | ||
tag: "${{env.PLUGIN_VERSION_RC}} --force" | ||
tag_push: '--force' | ||
- name: Push to COCOAPODS | ||
run: | | ||
pod trunk me | ||
pod trunk push AppsFlyerAdobeAEPExtension-qa.podspec | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: Prepare plugin for production | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
branches: | ||
- 'main' | ||
|
||
jobs: | ||
Prepare-Plugin-For-Production: | ||
if: startsWith(github.head_ref, 'releases/') | ||
name: Prepare for production after testing the plugin | ||
runs-on: macos-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: PR branch check | ||
uses: mdecoleman/[email protected] | ||
id: vars | ||
with: | ||
repo-token: ${{ secrets.CI_GITHUB_TOKEN }} | ||
- name: Determine release tag and release branch | ||
run: | | ||
TAG=$(echo "${{ steps.vars.outputs.branch }}" | grep -Eo '[0-9]+.[0-9]+.[0-9]+') | ||
echo "from branch: ${{github.head_ref}}" | ||
echo "PLUGIN_VERSION=$TAG" >> $GITHUB_ENV | ||
- name: run script | ||
run: bash .github/bash_scripts/release.sh ${{env.PLUGIN_VERSION}} | ||
- name: Commit and Push | ||
run : | | ||
git add . | ||
git commit -m"Commited from github action - prepaing the repo for production." | ||
git push origin HEAD:${{ steps.vars.outputs.branch }} --force |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
|
||
name: Release plugin to QA | ||
|
||
on: | ||
push: | ||
branches: | ||
- releases/[0-9]+.x.x/[0-9]+.[0-9]+.x/[0-9]+.[0-9]+.[0-9]+-rc[0-9]+ | ||
|
||
jobs: | ||
Check-If-ReleaseNotes-Pushed: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
answer: ${{ steps.filter.outputs.releasenotesfile }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: dorny/paths-filter@v2 | ||
id: filter | ||
with: | ||
filters: | | ||
releasenotesfile: | ||
- 'releasenotes.**' | ||
# Run-Unit-Tests: | ||
# needs: Check-If-ReleaseNotes-Pushed | ||
# if: needs.Check-If-ReleaseNotes-Pushed.outputs.answer == 'false' | ||
# uses: ./.github/workflows/unit-tests-workflow.yml | ||
|
||
Prepere-To-QA-And-Release: | ||
needs: [Check-If-ReleaseNotes-Pushed] | ||
if: needs.Check-If-ReleaseNotes-Pushed.outputs.answer == 'false' | ||
uses: ./.github/workflows/prepare-for-QA-&-release.yml | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
name: Release plugin to production | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- closed | ||
branches: | ||
- 'main' | ||
# - 'dev/add-release-workflow' | ||
|
||
jobs: | ||
Deploy-To-Production: | ||
if: github.event.pull_request.merged == true && startsWith(github.head_ref, 'releases/') | ||
runs-on: [ios, self-hosted] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: PR branch check | ||
uses: mdecoleman/[email protected] | ||
id: vars | ||
with: | ||
repo-token: ${{ secrets.CI_GITHUB_TOKEN }} | ||
- name: Determine release tag and release branch | ||
run: | | ||
TAG=$(echo "${{ steps.vars.outputs.branch }}" | grep -Eo '[0-9]+.[0-9]+.[0-9]+') | ||
echo "PLUGIN_VERSION=$TAG" >> $GITHUB_ENV | ||
echo "RELEASE_BRANCH_NAME=${{ steps.vars.outputs.branch }}" >> $GITHUB_ENV | ||
echo "push new release >> $TAG" | ||
echo "from branch: ${{github.head_ref}}" | ||
- name: Create release and tag | ||
env: | ||
TAG: ${{env.PLUGIN_VERSION}} | ||
uses: "actions/github-script@v5" | ||
with: | ||
script: | | ||
try { | ||
await github.rest.repos.createRelease({ | ||
draft: false, | ||
generate_release_notes: false, | ||
name: process.env.TAG, | ||
owner: context.repo.owner, | ||
prerelease: false, | ||
repo: context.repo.repo, | ||
tag_name: process.env.TAG | ||
}); | ||
} catch (error) { | ||
core.setFailed(error.message); | ||
} | ||
- name: Install Cocoapods | ||
run: gem install cocoapods | ||
- name: Push to COCOAPODS | ||
run: | | ||
pod trunk me | ||
pod trunk push AppsFlyerAdobeAEPExtension.podspec | ||
- name: Notify with SLack | ||
uses: slackapi/[email protected] | ||
with: | ||
payload: | | ||
{ | ||
"appsflyer_version": "${{env.PLUGIN_VERSION}}" | ||
} | ||
env: | ||
SLACK_WEBHOOK_URL: ${{ secrets.CI_SLACK_WEBHOOK_URL }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# name: CI - Tests | ||
# on: | ||
# push: | ||
# branches-ignore: | ||
# - 'master' | ||
# - 'releases/**' | ||
# workflow_call: | ||
# jobs: | ||
# Tests: | ||
# runs-on: macos-12 | ||
# steps: | ||
# - uses: actions/checkout@v2 | ||
# - uses: maxim-lobanov/setup-xcode@v1 | ||
# with: | ||
# xcode-version: latest-stable | ||
# - name: create Podfile | ||
# run: bash .github/bash_scripts/podfile_creation.sh | ||
# - name: CocoaPod Install | ||
# run: pod install | ||
# - name: Test | ||
# run: xcodebuild test -scheme segment-appsflyer-ios -workspace segment-appsflyer-ios.xcworkspace -destination 'platform=iOS Simulator,name=iPhone 13' | xcpretty && exit ${PIPESTATUS[0]} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.