Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
ci-templates
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Package Registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Andri Joos
ci-templates
Commits
20de7069
Commit
20de7069
authored
11 months ago
by
Andri Joos
Browse files
Options
Downloads
Patches
Plain Diff
add flutter-android.gitlab-ci.yml
parent
a797012e
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
flutter/flutter-android.gitlab-ci.yml
+60
-0
60 additions, 0 deletions
flutter/flutter-android.gitlab-ci.yml
with
60 additions
and
0 deletions
flutter/flutter-android.gitlab-ci.yml
0 → 100644
+
60
−
0
View file @
20de7069
# Required variables:
## SIGNING_KEYSTORE: The keystore, base64 encoded
## SIGNING_STORE_FILE: The path to the keystore, storeFile property in the signing.properties file
## SIGNING_STORE_PW: The password for the keystore, keyPassword property in the signing.properties file
## SIGNING_KEY_PW: The password for the key, keyPassword property in the signing.properties file
## SIGNING_KEY_ALIAS: The alias for the key, keyAlias property in the signing.properties file
## APP_DIRECTORY: The directory of the app
## APP_NAME: The name of the output aab, the resulting apk will be named ${APP_NAME}_${APPLICATION_VERSION}.apk
## APPLICATION_VERSION: The build name of the application
## APPLICATION_BUILD_NUMBER: The build number of the application
stages
:
-
build
variables
:
SIGNING_PROPERTIES_FILE
:
android/signing.properties
SINGING_KEYSTORE_FILE
:
android/signing-keystore.jks
FLUTTER_ANDROID_IMAGE
:
registry.420joos.dev/flutter:3.19.0-android
android_build
:
stage
:
build
image
:
name
:
${FLUTTER_ANDROID_IMAGE}
pull_policy
:
always
tags
:
-
amd64
artifacts
:
paths
:
-
${APP_NAME}.aab
expire_in
:
1 day
script
:
-
cd ${APP_DIRECTORY}
-
echo "storePassword=$SIGNING_STORE_PW" >> $SIGNING_PROPERTIES_FILE
-
echo "keyPassword=$SIGNING_KEY_PW" >> $SIGNING_PROPERTIES_FILE
-
echo "keyAlias=$SIGNING_KEY_ALIAS" >> $SIGNING_PROPERTIES_FILE
-
echo "storeFile=$SIGNING_STORE_FILE" >> $SIGNING_PROPERTIES_FILE
-
echo $SIGNING_KEYSTORE | base64 -d > $SINGING_KEYSTORE_FILE
-
flutter build appbundle --release --target-platform android-arm,android-arm64,android-x64 --build-name ${APPLICATION_VERSION} --build-number ${APPLICATION_BUILD_NUMBER}
after_script
:
-
mv ${APP_DIRECTORY}/build/app/outputs/bundle/release/app-release.aab ./{APP_NAME}.aab
apks
:
stage
:
build
image
:
name
:
${FLUTTER_ANDROID_IMAGE}
pull_policy
:
always
tags
:
-
amd64
when
:
manual
needs
:
-
android_build
artifacts
:
paths
:
-
${APP_NAME}_${APPLICATION_VERSION}.apk
expire_in
:
1 day
script
:
-
echo $SIGNING_KEYSTORE | base64 -d > keystore.jks
-
java -jar /app/bundletool.jar build-apks --bundle=${APP_NAME}.aab --output=apks.apks --mode=universal --ks=keystore.jks --ks-pass=pass:$SIGNING_STORE_PW --ks-key-alias=$SIGNING_KEY_ALIAS --key-pass=pass:$SIGNING_KEY_PW
-
unzip -q apks.apks -d apks
-
mv apks/universal.apk ./${APP_NAME}_${APPLICATION_VERSION}.apk
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment