Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
org.benoitharrault.random
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
android
org.benoitharrault.random
Commits
0bb7f103
Commit
0bb7f103
authored
4 years ago
by
Benoît Harrault
Browse files
Options
Downloads
Patches
Plain Diff
Add automatic tag creation on release CI step
parent
a15bfa3a
No related branches found
No related tags found
No related merge requests found
Pipeline
#1437
failed
4 years ago
Stage: build-debug
Stage: build-release
Stage: release
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitlab-ci.yml
+74
-58
74 additions, 58 deletions
.gitlab-ci.yml
android/gradle.properties
+2
-2
2 additions, 2 deletions
android/gradle.properties
with
76 additions
and
60 deletions
.gitlab-ci.yml
+
74
−
58
View file @
0bb7f103
image
:
cirrusci/flutter:latest
stages
:
-
test
-
update
# - update
-
build-debug
-
build-release
-
release
-
deploy
tests
:
stage
:
test
script
:
-
flutter test
interruptible
:
true
update
:
stage
:
update
script
:
-
flutter packages get
-
flutter packages upgrade
interruptible
:
true
# update:
# stage: update
# script:
# - flutter packages get
# - flutter packages upgrade
# interruptible: true
android:build-debug
:
stage
:
build-debug
script
:
# Flutter local configuration
-
echo flutter.sdk=$FLUTTER_PATH > android/local.properties
-
echo sdk.dir=$ANDROID_SDK_PATH >> android/local.properties
-
echo flutter.buildMode=debug >> android/local.properties
# Android signing
-
echo "$ANDROID_DEBUG_KEYSTORE_FILE" | base64 -d > android/app/my.keystore
-
echo storeFile=my.keystore > android/key.properties
-
echo storePassword=$ANDROID_DEBUG_KEYSTORE_PASSWORD >> android/key.properties
-
echo keyAlias=$ANDROID_DEBUG_KEY_ALIAS >> android/key.properties
-
echo keyPassword=$ANDROID_DEBUG_KEY_PASSWORD >> android/key.properties
# build flutter app
-
flutter packages get
-
flutter clean
-
flutter build apk --debug
# prepare artifact
#
#
Flutter local configuration
#
- echo flutter.sdk=$FLUTTER_PATH > android/local.properties
#
- echo sdk.dir=$ANDROID_SDK_PATH >> android/local.properties
#
- echo flutter.buildMode=debug >> android/local.properties
#
#
Android signing
#
- echo "$ANDROID_DEBUG_KEYSTORE_FILE" | base64 -d > android/app/my.keystore
#
- echo storeFile=my.keystore > android/key.properties
#
- echo storePassword=$ANDROID_DEBUG_KEYSTORE_PASSWORD >> android/key.properties
#
- echo keyAlias=$ANDROID_DEBUG_KEY_ALIAS >> android/key.properties
#
- echo keyPassword=$ANDROID_DEBUG_KEY_PASSWORD >> android/key.properties
#
#
build flutter app
#
- flutter packages get
#
- flutter clean
#
- flutter build apk --debug
#
#
prepare artifact
-
find . -name "*.apk"
# where is my apk?
artifacts
:
paths
:
-
build/app/outputs/apk/debug
expire_in
:
1 week
interruptible
:
true
#
artifacts:
#
paths:
#
- build/app/outputs/apk/debug
#
expire_in: 1 week
#
interruptible: true
android:build-release
:
stage
:
build-release
only
:
-
master
#
only:
#
- master
dependencies
:
-
android:build-debug
script
:
# Flutter local configuration
-
echo flutter.sdk=$FLUTTER_PATH > android/local.properties
-
echo sdk.dir=$ANDROID_SDK_PATH >> android/local.properties
-
echo flutter.buildMode=release >> android/local.properties
# Android signing
-
echo "$ANDROID_KEYSTORE_FILE" | base64 -d > android/app/my.keystore
-
echo storeFile=my.keystore > android/key.properties
-
echo storePassword=$ANDROID_KEYSTORE_PASSWORD >> android/key.properties
-
echo keyAlias=$ANDROID_KEY_ALIAS >> android/key.properties
-
echo keyPassword=$ANDROID_KEY_PASSWORD >> android/key.properties
# build flutter app
-
flutter packages get
-
flutter clean
-
flutter build apk --release
# prepare artifact
#
#
Flutter local configuration
#
- echo flutter.sdk=$FLUTTER_PATH > android/local.properties
#
- echo sdk.dir=$ANDROID_SDK_PATH >> android/local.properties
#
- echo flutter.buildMode=release >> android/local.properties
#
#
Android signing
#
- echo "$ANDROID_KEYSTORE_FILE" | base64 -d > android/app/my.keystore
#
- echo storeFile=my.keystore > android/key.properties
#
- echo storePassword=$ANDROID_KEYSTORE_PASSWORD >> android/key.properties
#
- echo keyAlias=$ANDROID_KEY_ALIAS >> android/key.properties
#
- echo keyPassword=$ANDROID_KEY_PASSWORD >> android/key.properties
#
#
build flutter app
#
- flutter packages get
#
- flutter clean
#
- flutter build apk --release
#
#
prepare artifact
-
find . -name "*.apk"
# where is my apk?
artifacts
:
paths
:
-
build/app/outputs/apk/release
expire_in
:
1 week
interruptible
:
true
# artifacts:
# paths:
# - build/app/outputs/apk/release
# expire_in: 1 week
# interruptible: true
application:release
:
stage
:
release
image
:
name
:
alpine/git
entrypoint
:
[
"
"
]
# only:
# - master
dependencies
:
-
android:build-release
script
:
-
git config user.email "${GITLAB_USER_EMAIL}"
-
git config user.name "${GITLAB_USER_NAME}"
-
git remote remove origin
-
git remote add release-tag-origin https://oauth2:${GITLAB_ACCESS_TOKEN}@${CI_SERVER_HOST}/${CI_PROJECT_PATH}
-
VERSION_FILE="$(find . -name 'gradle.properties' | head -n1)"
-
VERSION_NAME="$(grep '^app.versionName=' "${VERSION_FILE}" | cut -d'=' -f2)"
-
VERSION_CODE="$(grep '^app.versionCode=' "${VERSION_FILE}" | cut -d'=' -f2)"
-
TAG_NAME="Release_${VERSION_CODE}_${VERSION_NAME}"
-
echo "${TAG_NAME}"
-
git tag -a "Release_${TAG_NAME}" -m "Auto-Release ${VERSION_NAME} (${VERSION_CODE})"
-
git push release-tag-origin "Release_${TAG_NAME}"
android:deploy
:
stage
:
deploy
only
:
-
master
-
tags
dependencies
:
-
a
ndroid:build-
release
-
a
pplication:
release
script
:
-
wget ${REPOSITORY_UPDATE_WEBHOOK}?token=${REPOSITORY_TOKEN}
This diff is collapsed.
Click to expand it.
android/gradle.properties
+
2
−
2
View file @
0bb7f103
org.gradle.jvmargs
=
-Xmx1536M
android.useAndroidX
=
true
android.enableJetifier
=
true
app.versionName
=
1.0.
1
app.versionCode
=
2
app.versionName
=
1.0.
2
app.versionCode
=
3
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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