diff --git a/.github/workflows/build-custom-codepush.yml b/.github/workflows/build-custom-codepush.yml index 9d3f83e..559e34e 100644 --- a/.github/workflows/build-custom-codepush.yml +++ b/.github/workflows/build-custom-codepush.yml @@ -4,9 +4,9 @@ on: workflow_dispatch: inputs: targetVersion: - description: 'Target version, feks: 1.0.0-' + description: 'Versjonsnavn fra AppCenter, feks: 1.0.0-' required: true - default: '1.0.0-leiferik' + default: '1.0.0-appcenter-script' jobs: build_codepush: runs-on: macos-13 diff --git a/android/app/build.gradle b/android/app/build.gradle index aae1309..2dc6eba 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -80,7 +80,7 @@ android { minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion versionCode 1 - versionName "1.0.0-leiferik" + versionName "1.0.1" } signingConfigs { debug { diff --git a/app/App.tsx b/app/App.tsx index f1ea23c..9e89108 100644 --- a/app/App.tsx +++ b/app/App.tsx @@ -1,10 +1,3 @@ -/** - * Sample React Native App - * https://github.com/facebook/react-native - * - * @format - */ - import React from 'react'; import type {PropsWithChildren} from 'react'; import { diff --git a/appcenter-pre-build.sh b/appcenter-pre-build.sh new file mode 100644 index 0000000..848038a --- /dev/null +++ b/appcenter-pre-build.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash + + +if [ "$APPCENTER_BRANCH" != "master" ]; then + if [ -n "$APPCENTER_XCODE_PROJECT" ]; then + current_version=$(/usr/libexec/PlistBuddy -c "Print :CFBundleShortVersionString" "$APPCENTER_SOURCE_DIRECTORY/ios/RNSkolenApp/Info.plist") + new_version="$current_version-$APPCENTER_BRANCH" + echo "Setting iOS version to $new_version" + /usr/libexec/PlistBuddy -c "Set :CFBundleShortVersionString $new_version" "$APPCENTER_SOURCE_DIRECTORY/ios/RNSkolenApp/Info.plist" + fi + if [ -n "$APPCENTER_ANDROID_VARIANT" ]; then + current_version=$(grep -o 'versionName "[^"]*"' "$APPCENTER_SOURCE_DIRECTORY/android/app/build.gradle" | cut -d '"' -f 2) + new_version="$current_version-$APPCENTER_BRANCH" + echo "Setting Android version to $new_version" + sed -i '' "s/versionName \"$current_version\"/versionName \"$new_version\"/" "$APPCENTER_SOURCE_DIRECTORY/android/app/build.gradle" + fi +fi diff --git a/ios/RNSkolenApp.xcodeproj/project.pbxproj b/ios/RNSkolenApp.xcodeproj/project.pbxproj index 4b2e325..4539cad 100644 --- a/ios/RNSkolenApp.xcodeproj/project.pbxproj +++ b/ios/RNSkolenApp.xcodeproj/project.pbxproj @@ -497,7 +497,6 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = "1.0.0-leiferik"; OTHER_LDFLAGS = ( "$(inherited)", "-ObjC", @@ -524,7 +523,6 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = "1.0.0-leiferik"; OTHER_LDFLAGS = ( "$(inherited)", "-ObjC", diff --git a/ios/RNSkolenApp/Info.plist b/ios/RNSkolenApp/Info.plist index 37cbacd..4d41511 100644 --- a/ios/RNSkolenApp/Info.plist +++ b/ios/RNSkolenApp/Info.plist @@ -17,7 +17,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - $(MARKETING_VERSION) + 1.0.1 CFBundleSignature ???? CFBundleVersion