From 73a4b54f9e77be0a6b6bfff8c071daef70419717 Mon Sep 17 00:00:00 2001 From: Ritesh Shukla Date: Thu, 10 Apr 2025 23:22:42 +0530 Subject: [PATCH] Added Support for version bump --- .github/workflows/publish-beta.yml | 20 ++++++++++++++------ ios/fastlane/Fastfile | 16 ++++++++-------- package-lock.json | 8 ++++++++ package.json | 3 ++- 4 files changed, 32 insertions(+), 15 deletions(-) diff --git a/.github/workflows/publish-beta.yml b/.github/workflows/publish-beta.yml index 0cb6254a..e849c138 100644 --- a/.github/workflows/publish-beta.yml +++ b/.github/workflows/publish-beta.yml @@ -16,13 +16,18 @@ jobs: uses: actions/setup-node@v4 with: node-version: 20 - - - name: 💬 Echo package.json version to Github ENV - run: echo VERSION_NUMBER=$(npm version patch --tag-version-prefix="" --no-commit-hooks) >> $GITHUB_ENV - + - name: 🟢 Run npm run init run: npm run init + + + - name: 💬 Echo package.json version to Github ENV + run: echo VERSION_NUMBER=$(node -p -e "require('./package.json').version") >> $GITHUB_ENV + + - name: Version Up + run: npx react-native bump-version --type patch + - name: 🤫 Output App Store Connect API Key JSON to Fastlane run: echo -e '${{ secrets.APPSTORE_CONNECT_API_KEY_JSON }}' > appstore_connect_api_key.json working-directory: ./ios/fastlane @@ -39,11 +44,14 @@ jobs: run: npm run fastlane:android:build # Commit Fastlane Xcode build number increment - - name: 🔢 Commit Xcode build number increment + - name: 🔢 Commit changes for version increment uses: stefanzweifel/git-auto-commit-action@v5 with: commit_message: "[skip actions]" - file_pattern: "ios/Jellify.xcodeproj/project.pbxproj" + file_pattern: | + ios/Jellify.xcodeproj/project.pbxproj + package.json + android/app/build.gradle - name: 🔢 Set artifact version numbers run: | diff --git a/ios/fastlane/Fastfile b/ios/fastlane/Fastfile index d54930cf..c90cacbb 100644 --- a/ios/fastlane/Fastfile +++ b/ios/fastlane/Fastfile @@ -38,15 +38,15 @@ platform :ios do app_identifier: "com.cosmonautical.jellify", readonly: true ) + # we dont need to increment version number here anymore, because we will increment it in the github action + # increment_version_number( + # version_number: ENV['VERSION_NUMBER'], + # xcodeproj: "Jellify.xcodeproj" + # ) - increment_version_number( - version_number: ENV['VERSION_NUMBER'], - xcodeproj: "Jellify.xcodeproj" - ) - - increment_build_number( - xcodeproj: "Jellify.xcodeproj" - ) + # increment_build_number( + # xcodeproj: "Jellify.xcodeproj" + # ) build_app( scheme: "Jellify - Release", workspace: "Jellify.xcworkspace", diff --git a/package-lock.json b/package-lock.json index 67337a4b..84825ccb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -77,6 +77,7 @@ "jest": "^29.6.3", "jscodeshift": "^0.15.2", "prettier": "^2.8.8", + "react-native-cli-bump-version": "^1.5.1", "react-test-renderer": "18.3.1", "typescript": "5.7.3" }, @@ -17070,6 +17071,13 @@ } } }, + "node_modules/react-native-cli-bump-version": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/react-native-cli-bump-version/-/react-native-cli-bump-version-1.5.1.tgz", + "integrity": "sha512-C7Vss+BBD4iNMnn2YR00cU+GDDPZ+LDmIqWoh3FPwI/LBsJ/Vp5qanwtyVYRPcIe7Cg1PPB8WdeZ8XcnqF5Klw==", + "dev": true, + "license": "MIT" + }, "node_modules/react-native-device-info": { "version": "14.0.4", "resolved": "https://registry.npmjs.org/react-native-device-info/-/react-native-device-info-14.0.4.tgz", diff --git a/package.json b/package.json index 5a927990..51a392a7 100644 --- a/package.json +++ b/package.json @@ -88,10 +88,11 @@ "jest": "^29.6.3", "jscodeshift": "^0.15.2", "prettier": "^2.8.8", + "react-native-cli-bump-version": "^1.5.1", "react-test-renderer": "18.3.1", "typescript": "5.7.3" }, "engines": { "node": ">=18" } -} +} \ No newline at end of file