NTP-47546 | Codepush action changes (#1124)

This commit is contained in:
Mantri Ramkishor
2025-04-04 23:33:36 +05:30
committed by GitHub
parent e604366ebb
commit b5189f13f7

97
.github/workflows/inhouseCodePush.yml vendored Normal file
View File

@@ -0,0 +1,97 @@
name: Navi CodePush Deployment
on:
workflow_dispatch:
inputs:
environment:
description: 'Environment to deploy to (QA/Prod)'
required: true
type: choice
options:
- QA
- Prod
minTargetVersion:
description: 'Minimum target version'
required: true
type: string
maxTargetVersion:
description: 'Maximum target version'
required: true
type: string
description:
description: 'Update description'
required: true
type: string
jobs:
deploy:
runs-on: [default]
outputs:
package_version: ${{ steps.get_version.outputs.version }}
build_number: ${{ steps.get_version.outputs.buildNumber }}
steps:
- name: Checkout
uses: actions/checkout@v2
with:
token: ${{ secrets.MY_REPO_PAT }}
submodules: recursive
- name: Set Node.js 16.x
uses: actions/setup-node@v3
with:
node-version: 16.x
- name: Setup Nexus authentication
run: |
echo "@navi:registry=https://nexus.cmd.navi-tech.in/repository/navi-commons/" > .npmrc
echo "//nexus.cmd.navi-tech.in/repository/navi-commons/:_authToken=${{ secrets.NEXUS_AUTH_TOKEN }}" >> .npmrc
echo "@navi:registry=https://nexus.cmd.navi-tech.in/repository/npm-packages/" >> .npmrc
echo "//nexus.cmd.navi-tech.in/repository/npm-packages/:_authToken=${{ secrets.NEXUS_AUTH_TOKEN }}" >> .npmrc
- name: Get version from package.json
id: get_version
run: |
VERSION=$(node -p "require('./package.json').version")
BUILD_NUMBER=$(node -p "require('./package.json').buildNumber")
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "buildNumber=$BUILD_NUMBER" >> $GITHUB_OUTPUT
- name: Install yarn
run: npm install --global yarn
- name: Install dependencies
run: |
yarn
yarn add @navi/navi-codepush-cli@1.0.4
# Environment specific steps
- name: Prepare QA Environment
if: github.event.inputs.environment == 'QA'
run: yarn move:qa && yarn prepare-codepush-field-build
- name: Prepare Prod Environment
if: github.event.inputs.environment == 'Prod'
run: yarn move:prod && yarn prepare-codepush-field-build
- name: Deploy to QA
if: github.event.inputs.environment == 'QA'
run: |
navi-codepush-cli \
--app cosmos \
--versionMin ${{ github.event.inputs.minTargetVersion }} \
--versionMax ${{ github.event.inputs.maxTargetVersion }} \
--desc "${{ github.event.inputs.description }}" \
--platform android \
--env qa
- name: Deploy to Production
if: github.event.inputs.environment == 'Prod'
run: |
navi-codepush-cli \
--app cosmos \
--versionMin ${{ github.event.inputs.minTargetVersion }} \
--versionMax ${{ github.event.inputs.maxTargetVersion }} \
--desc "${{ github.event.inputs.description }}" \
--platform android \
--env prod