From 5ce346a1bce4850a95c31b53ca39d0da236a6cea Mon Sep 17 00:00:00 2001 From: Moe Poi ~ Date: Thu, 26 May 2022 06:13:00 +0000 Subject: [PATCH] Update .gitlab-ci.yml file --- .gitlab-ci.yml | 92 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..b2bab78 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,92 @@ +variables: + IOS_XCODE_PROJECT_NAME: "nekoya" + FLAVOR: "production" + +stages: + - archive + +android:debug: + stage: archive + before_script: + - flutter create . + - flutter packages get + - flutter clean + script: + - flutter doctor --android-licenses + - flutter build apk --flavor ${FLAVOR} --debug + artifacts: + paths: + - "**/**/**/**/**/**/*.apk" + expire_in: 1 day + +android:release: + stage: archive + before_script: + - flutter create . + - flutter packages get + - flutter clean + script: + - flutter doctor --android-licenses + - flutter build apk --flavor ${FLAVOR} --release + artifacts: + paths: + - "**/**/**/**/**/**/*.apk" + expire_in: 1 day + +ios:debug: + stage: archive + before_script: + - flutter create . + - flutter packages get + - flutter clean + script: + - flutter build ios --flavor ${FLAVOR} + - if [ -d archive ]; then rm -rf archive; fi && mkdir archive + - if [ -d artifact ]; then rm -rf artifact; fi && mkdir artifact + - export PLIST_DIRECTORY="ci-cd/iOS/${FLAVOR}/debug" + - cd ios + - pod install; + - xcodebuild clean archive -quiet -workspace ${IOS_XCODE_PROJECT_NAME}.xcworkspace -scheme ${FLAVOR} -archivePath "../archive/${IOS_XCODE_PROJECT_NAME}.xcarchive"; + - xcodebuild -quiet -exportArchive -archivePath "../archive/${IOS_XCODE_PROJECT_NAME}.xcarchive" -exportPath ../artifact/ -exportOptionsPlist ${PLIST_DIRECTORY}/*.plist + artifacts: + paths: + - "artifact/*.ipa" + expire_in: 1 day + +ios:release: + stage: archive + before_script: + - flutter create . + - flutter packages get + - flutter clean + script: + - flutter build ios --flavor ${FLAVOR} + - if [ -d archive ]; then rm -rf archive; fi && mkdir archive + - if [ -d artifact ]; then rm -rf artifact; fi && mkdir artifact + - export PLIST_DIRECTORY="ci-cd/iOS/${FLAVOR}/release" + - cd ios + - pod install; + - xcodebuild clean archive -quiet -workspace ${IOS_XCODE_PROJECT_NAME}.xcworkspace -scheme ${FLAVOR} -archivePath "../archive/${IOS_XCODE_PROJECT_NAME}.xcarchive"; + - xcodebuild -quiet -exportArchive -archivePath "../archive/${IOS_XCODE_PROJECT_NAME}.xcarchive" -exportPath ../artifact/ -exportOptionsPlist ${PLIST_DIRECTORY}/*.plist + artifacts: + paths: + - "artifact/*.ipa" + expire_in: 1 day + +web:debug: + stage: archive + before_script: + - flutter create . + - flutter packages get + - flutter clean + script: + - flutter build web --flavor ${FLAVOR} --debug + +web:release: + stage: archive + before_script: + - flutter create . + - flutter packages get + - flutter clean + script: + - flutter build web --flavor ${FLAVOR} --release \ No newline at end of file