-
Notifications
You must be signed in to change notification settings - Fork 202
61 lines (54 loc) · 2.66 KB
/
deploy-to-QA.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
name: Deploy To QA
on:
workflow_call:
jobs:
Deploy-to-QA:
runs-on: ubuntu-latest
environment: Staging
steps:
- uses: actions/checkout@v3
- name: Login to Github
env:
COMMIT_AUTHOR: ${{ secrets.CI_COMMIT_AUTHOR }}
COMMIT_EMAIL: ${{ secrets.CI_COMMIT_EMAIL }}
run: |
git config --global user.name $COMMIT_AUTHOR
git config --global user.email $COMMIT_EMAIL
- name: Check if fixed version is on Jira
env:
JIRA_TOKEN: ${{ secrets.CI_JIRA_TOKEN }}
BRANCH_NAME: ${{github.ref_name}}
run: |
fixed_version_found=false
plugin_version=$(echo "$BRANCH_NAME" | grep -Eo '[0-9].[0-9]+.[0-9]+')
jira_fixed_version="React Native SDK v$plugin_version"
echo "JIRA_FIXED_VERSION=$jira_fixed_version" >> $GITHUB_ENV
chmod +x .github/workflows/scripts/releaseNotesGenerator.sh
.github/workflows/scripts/releaseNotesGenerator.sh $JIRA_TOKEN "$jira_fixed_version"
- name: Check version alignment between platforms
env:
BRANCH_NAME: ${{github.ref_name}}
run: |
plugin_version=$(echo "$BRANCH_NAME" | grep -Eo '[0-9].[0-9]+.[0-9]+')
chmod +x .github/workflows/scripts/versionsAlignmentValidator.sh
.github/workflows/scripts/versionsAlignmentValidator.sh "$plugin_version"
- name: Update package.json file
run: |
plugin_rc_version=$(echo "${{github.ref_name}}" | grep -Eo '[0-9].[0-9]+.[0-9]+-rc[0-9]+')
echo "Updating plugin to version $plugin_rc_version"
npm version $plugin_rc_version
git push
- name: Push to NPM
env:
CI_NPM_TOKEN: ${{ secrets.CI_NPM_TOKEN }}
run: |
echo "//registry.npmjs.org/:_authToken=$CI_NPM_TOKEN" > ~/.npmrc
npm publish --tag QA
- name: Generate and send slack report
env:
SLACK_TOKEN: ${{ secrets.CI_SLACK_TOKEN }}
run: |
ios_sdk_version=$(cat react-native-appsflyer.podspec | grep '\'AppsFlyerFramework\' | grep -Eo '[0-9].[0-9]+.[0-9]+')
android_sdk_version=$(cat android/build.gradle | grep 'com.appsflyer:af-android-sdk' | grep -Eo '[0-9].[0-9]+.[0-9]+')
CHANGES=$(cat "${{env.JIRA_FIXED_VERSION}}-releasenotes".txt)
curl -X POST -H 'Content-type: application/json' --data '{"jira_fixed_version": "'"${{env.JIRA_FIXED_VERSION}}"'", "deploy_type": "QA", "install_tag": "QA", "git_branch": "'"${{github.ref_name}}"'", "changes_and_fixes": "'"$CHANGES"'", "android_dependencie": "'"$android_sdk_version"'", "ios_dependencie": "'"$ios_sdk_version"'"}' "$SLACK_TOKEN"