Skip to content

Commit

Permalink
Merge pull request #4 from bekk/appcenter_script
Browse files Browse the repository at this point in the history
Oppdaterer script for AppCenter og GitHub action
  • Loading branch information
leiferikbjorkli authored Sep 5, 2023
2 parents 0296d64 + b203108 commit 75571a4
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 13 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build-custom-codepush.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ on:
workflow_dispatch:
inputs:
targetVersion:
description: 'Target version, feks: 1.0.0-<navn>'
description: 'Versjonsnavn fra AppCenter, feks: 1.0.0-<branchname>'
required: true
default: '1.0.0-leiferik'
default: '1.0.0-appcenter-script'
jobs:
build_codepush:
runs-on: macos-13
Expand Down
2 changes: 1 addition & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
7 changes: 0 additions & 7 deletions app/App.tsx
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
17 changes: 17 additions & 0 deletions appcenter-pre-build.sh
Original file line number Diff line number Diff line change
@@ -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
2 changes: 0 additions & 2 deletions ios/RNSkolenApp.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,6 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = "1.0.0-leiferik";
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
Expand All @@ -524,7 +523,6 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = "1.0.0-leiferik";
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
Expand Down
2 changes: 1 addition & 1 deletion ios/RNSkolenApp/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>$(MARKETING_VERSION)</string>
<string>1.0.1</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down

0 comments on commit 75571a4

Please sign in to comment.