Skip to content

Commit

Permalink
bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
quetool committed Dec 15, 2023
1 parent a66cbb8 commit 11a4e0a
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 8 deletions.
23 changes: 17 additions & 6 deletions .github/workflows/build-android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,24 @@ jobs:
PROJECT_ID: ${{ secrets.PROJECT_ID }}
run: |
# Get app version from file
FILE_VALUE=`cat $GITHUB_WORKSPACE/lib/version.dart`
VERSION=`echo $FILE_VALUE | sed "s/[^']*'\([^']*\)'.*/\1/"`
VNAME=`echo $VERSION | sed "s/+.*//"`
VBUILD=${VERSION#*+}
# Get app version from file
GRADLE_FILE=android/gradle.properties
VERSION_FILE=$GITHUB_WORKSPACE/lib/version.dart
VERSION=`echo $(cat $VERSION_FILE) | sed "s/[^']*'\([^']*\)'.*/\1/"`
# Set versionName on gradle.properties
awk -F"=" -v newval="$VERSION" 'BEGIN{OFS=FS} $1=="versionName"{$2=newval}1' $GRADLE_FILE > "$GRADLE_FILE.tmp" && mv "$GRADLE_FILE.tmp" $GRADLE_FILE
# Increment versionCode (build number) on gradle.properties
awk -F"=" 'BEGIN{OFS=FS} $1=="versionCode"{$2=$2+1}1' $GRADLE_FILE > "$GRADLE_FILE.tmp" && mv "$GRADLE_FILE.tmp" $GRADLE_FILE
# Get new versionCode
NEXT_BUILD=$(grep 'versionCode' $GRADLE_FILE | cut -d'=' -f2)
# Build ios app with flutter
flutter build apk --build-name $VNAME --build-number $VBUILD --dart-define="PROJECT_ID=$PROJECT_ID" --release
# Build Android app with flutter
flutter build apk --build-name $VERSION --build-number $NEXT_BUILD --dart-define="PROJECT_ID=$PROJECT_ID" --release
# Setup Node
- name: Setup Node
uses: actions/setup-node@v3
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/build-ios.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Build iOS App

on: # workflow_dispatch
on:
workflow_dispatch:
release:
types: [ published ]
Expand Down Expand Up @@ -85,7 +85,6 @@ jobs:
VERSION=`echo $FILE_VALUE | sed "s/[^']*'\([^']*\)'.*/\1/"`
# Build ios app with flutter
# flutter build ios --dart-define="PROJECT_ID=$PROJECT_ID" --config-only --release
flutter build ios --build-name $VERSION --dart-define="PROJECT_ID=$PROJECT_ID" --config-only --release
cd ios
Expand Down
2 changes: 2 additions & 0 deletions example/android/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
org.gradle.jvmargs=-Xmx1536M
android.useAndroidX=true
android.enableJetifier=true
versionName=3.0.2
versionCode=10

0 comments on commit 11a4e0a

Please sign in to comment.