-
Notifications
You must be signed in to change notification settings - Fork 18
81 lines (64 loc) · 2.84 KB
/
deploy-standard-checkout.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
name: Deploy Standard Checkout
on: repository_dispatch
env:
DEPLOYMENT_VERSION: ${{github.event.client_payload.version}}
DEPLOYMENT_BRANCH_NAME: "release-v-${{github.event.client_payload.version}}"
jobs:
uts_and_build_generation:
runs-on: macOS-latest # nosemgrep : non-self-hosted-runner
steps:
- name: Select Xcode
run: sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer
- name: Xcode Version
run: /usr/bin/xcodebuild -version
- name: Check out razorpay-ios repository code
uses: actions/checkout@v2
with:
repository: "razorpay/razorpay-ios"
token: "${{ secrets.CI_BOT_TOKEN }}"
- name: Set permission
run: exec chmod +x ./.github/scripts/run-uts.sh
- name: Running Standard Checkout Unit Tests
run: exec ./.github/scripts/run-uts.sh
- name: Set permission to run XCFramework Script
run: exec chmod +x ./.github/scripts/create-standard-checkout-build.sh
- name: Run Create XCFramework Script
run: exec ./.github/scripts/create-standard-checkout-build.sh
- name: Check out razorpay-pod repository code
uses: actions/checkout@v2
with:
repository: "razorpay/razorpay-pod"
token: "${{ secrets.CI_BOT_TOKEN }}"
- name: Set permission for PODSPEC Update
run: exec chmod +x ./.github/scripts/update_podspec_version.sh
- name: Update Release Version
run: exec ./.github/scripts/update_podspec_version.sh $DEPLOYMENT_VERSION
- name: Remove old Build
run: rm -rf ./Pod/Razorpay.xcframework
- name: Update new build
run: cp -R ~/Desktop/CheckoutOtpelf/ ./Pod
- name: Upload Release builds to Artifacts
uses: actions/upload-artifact@v3
with:
name: "Checkout-Releases-v${{env.DEPLOYMENT_VERSION}}"
path: ~/Desktop/CheckoutOtpelf
- name: Remove Framework Folder
run: rm -rf ./Pod/Razorpay.framework
- name: Create Branch and Commit Changes
uses: EndBug/add-and-commit@v9
with:
author_name: Ramprasad A
author_email: [email protected]
message: "Release standard checkout v${{env.DEPLOYMENT_VERSION}}"
new_branch: ${{env.DEPLOYMENT_BRANCH_NAME}}
add: "[./Pod, razorpay-pod.podspec]"
push: origin ${{env.DEPLOYMENT_BRANCH_NAME}} --set-upstream --force
- name: Create Pull Request
shell: bash
run: |
curl \
-X POST \
-H 'authorization: Bearer ${{ secrets.CI_BOT_TOKEN }}' \
-H "Accept: application/vnd.github+json" \
https://api.github.com/repos/razorpay/razorpay-pod/pulls \
-d '{"title":"v_${{env.DEPLOYMENT_VERSION}}_release","body":"Standard Checkout Deployment","head":"${{env.DEPLOYMENT_BRANCH_NAME}}","base":"master"}'