Restructured Build Process

This commit is contained in:
TheJoKlLa 2021-09-25 22:50:43 +02:00
parent 8c446e76cd
commit f954928a0d

View File

@ -25,16 +25,22 @@
variables: variables:
GIT_SUBMODULE_STRATEGY: recursive GIT_SUBMODULE_STRATEGY: recursive
LIB_RELEASE_FOLDER: 'Borepin\Borepin\bin\Release' LIB_RELEASE_FOLDER: 'Borepin\Borepin\bin\Release'
UWP_RELEASE_FOLDER: 'Borepin\Borepin.UWP\bin\x86\Release' UWP_RELEASE_FOLDER: 'Borepin\Borepin.UWP\bin\x86\Release'
TEST_FOLDER: 'Tests\bin\Release' ANDROID_RELEASE_FOLDER: 'Borepin/Borepin.Android/bin/Release/'
# DEPLOY_FOLDER: 'P:\Projects\YourApp\Builds' IOS_RELEASE_FOLDER: 'Borepin/Borepin.iOS/bin/iPhone/Debug/'
GTK_RELEASE_FOLDER: 'Borepin/Borepin.GTK/bin/Debug/'
NUGET_PATH: 'C:\ProgramData\chocolatey\bin\nuget.exe' NUGET_PATH: 'C:\ProgramData\chocolatey\bin\nuget.exe'
DOTNET_PATH: 'C:\Program Files\dotnet\dotnet.exe' DOTNET_PATH: 'C:\Program Files\dotnet\dotnet.exe'
MSBUILD_PATH: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\msbuild.exe' MSBUILD_PATH: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\msbuild.exe'
NUNIT_PATH: 'C:\ProgramData\chocolatey\bin\nunit3-console.exe' NUNIT_PATH: 'C:\ProgramData\chocolatey\bin\nunit3-console.exe'
JARSIGNER_PATH: 'C:\ProgramData\'
stages: stages:
- build - build
- test
- sign
- deploy - deploy
build_base: build_base:
@ -42,16 +48,13 @@ build_base:
tags: tags:
- xamarin - xamarin
- windows - windows
# only:
# - tags # the build process will only be started by git tag commits
script: script:
- '& "$env:NUGET_PATH" restore' # restore Nuget dependencies - '& "$env:NUGET_PATH" restore' # restore Nuget dependencies
- '& "$env:MSBUILD_PATH" /p:Configuration=Release /target:Restore /target:Borepin' # build the project - '& "$env:MSBUILD_PATH" /p:Configuration=Release /target:Restore /target:Borepin'
artifacts: artifacts:
expire_in: 1 week # save gitlab server space, we copy the files we need to deploy folder later on expire_in: 1 week
paths: paths:
- '$env:LIB_RELEASE_FOLDER' # saving exe to copy to deploy folder - '$env:LIB_RELEASE_FOLDER'
# - '$env:TEST_FOLDER\' # saving entire Test project so NUnit can run tests
build_UWP: build_UWP:
needs: needs:
@ -60,16 +63,13 @@ build_UWP:
tags: tags:
- xamarin - xamarin
- windows - windows
# only:
# - tags # the build process will only be started by git tag commits
script: script:
- '& "$env:NUGET_PATH" restore' # restore Nuget dependencies - '& "$env:NUGET_PATH" restore' # restore Nuget dependencies
- '& "$env:MSBUILD_PATH" /p:Configuration=Debug /target:Borepin_UWP' # build the project - '& "$env:MSBUILD_PATH" /p:Configuration=Debug /target:Borepin_UWP'
# artifacts: artifacts:
# expire_in: 1 week # save gitlab server space, we copy the files we need to deploy folder later on expire_in: 1 week
# paths: paths:
# - '$env:UWP_RELEASE_FOLDER' # saving exe to copy to deploy folder - '$env:UWP_RELEASE_FOLDER'
# - '$env:TEST_FOLDER\' # saving entire Test project so NUnit can run tests
build_Android: build_Android:
needs: needs:
@ -78,19 +78,13 @@ build_Android:
tags: tags:
- xamarin - xamarin
- windows - windows
# only:
# - tags # the build process will only be started by git tag commits
script: script:
- '& "$env:NUGET_PATH" restore' # restore Nuget dependencies - '& "$env:NUGET_PATH" restore' # restore Nuget dependencies
- '[System.IO.File]::WriteAllBytes("$(pwd)/fabaccess.keystore", [System.Convert]::FromBase64String($AndroidKeyStore))' - '& "$env:MSBUILD_PATH" /p:Configuration=Release /target:Borepin_Android:PackageForAndroid /p:AndroidKeyStore="False"'
- '& "$env:MSBUILD_PATH" /p:Configuration=Release /target:Borepin_Android:PackageForAndroid /target:Borepin_Android:SignAndroidPackage /p:AndroidKeyStore="True" /p:AndroidSigningKeyStore="$(pwd)/fabaccess.keystore" /p:AndroidSigningKeyPass="$AndroidKeyStore_Password" /p:AndroidSigningKeyAlias="$AndroidKeyStore_ID" /p:AndroidSigningStorePass="$AndroidKeyStore_Password"' # build the project
- rm "$(pwd)/fabaccess.keystore"
artifacts: artifacts:
expire_in: 1 week # save gitlab server space, we copy the files we need to deploy folder later on expire_in: 1 week
paths: paths:
- Borepin/Borepin.Android/bin/Release/org.fab_infra.fabaccess-Signed.aab # saving apk to copy to deploy folder - '$env:ANDROID_RELEASE_FOLDER'
- Borepin/Borepin.Android/bin/Release/
# - '$env:TEST_FOLDER\' # saving entire Test project so NUnit can run tests
build_iOS: build_iOS:
needs: needs:
@ -98,18 +92,14 @@ build_iOS:
stage: build stage: build
tags: tags:
- macos - macos
# only:
# - tags # the build process will only be started by git tag commits
script: script:
- 'nuget restore' # restore Nuget dependencies - 'nuget restore' # restore Nuget dependencies
- 'msbuild /t:Restore' - 'msbuild /t:Restore'
- 'msbuild /t:Borepin_iOS /p:Configuration=Debug /p:Platform=iPhone /p:ArchiveOnBuild=true /p:BuildIpa=true' # build the project /p:AndroidKeyStore=True - 'msbuild /t:Borepin_iOS /p:Configuration=Debug /p:Platform=iPhone /p:ArchiveOnBuild=true /p:BuildIpa=true'
artifacts: artifacts:
expire_in: 1 week # save gitlab server space, we copy the files we need to deploy folder later on expire_in: 1 week
paths: paths:
- Borepin/Borepin.iOS/bin/iPhone/Debug/Borepin.iOS.ipa - '$env:IOS_RELEASE_FOLDER'
- Borepin/Borepin.iOS/bin/iPhone/Debug/
# - '$env:TEST_FOLDER\' # saving entire Test project so NUnit can run tests
build_GTK: build_GTK:
needs: needs:
@ -118,96 +108,98 @@ build_GTK:
image: registry.gitlab.com/fabinfra/gtk-sharp-build:latest image: registry.gitlab.com/fabinfra/gtk-sharp-build:latest
tags: tags:
- docker - docker
# only:
# - tags # the build process will only be started by git tag commits
script: script:
- 'nuget restore' # restore Nuget dependencies - 'nuget restore' # restore Nuget dependencies
- 'msbuild -t:Borepin_GTK' # build the project /p:AndroidKeyStore=True - 'msbuild -t:Borepin_GTK'
artifacts: artifacts:
expire_in: 1 week # save gitlab server space, we copy the files we need to deploy folder later on expire_in: 1 week
paths: paths:
- Borepin/Borepin.GTK/bin/Debug/ - '$env:GTK_RELEASE_FOLDER'
# test_job: #sign_Android_internal:
# stage: test # only:
# tags: # - alpha
# - xamarin # - beta
# - windows # variables:
# # only: # - $CI_COMMIT_REF_PROTECTED
# # - tags # needs:
# script: # - build_Android
# - '& "$env:NUNIT_PATH" ".\$env:TEST_FOLDER\Tests.dll"' # running NUnit tests # stage: sign
# artifacts: # tags:
# when: always # save test results even when the task fails # - xamarin
# expire_in: 1 week # save gitlab server space, we copy the files we need to deploy folder later on # - windows
# paths: # script:
# - '.\TestResult.xml' # saving NUnit results to copy to deploy folder # - '[System.IO.File]::WriteAllBytes("$(pwd)/fabaccess.keystore", [System.Convert]::FromBase64String($AndroidKeyStore))'
# dependencies: # - '& "$env:JARSIGNER_PATH" -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore "$(pwd)/fabaccess.keystore" Borepin/Borepin.Android/bin/Release/org.fab_infra.fabaccess.aab "$AndroidKeyStore_ID_Internal" -storepass "$AndroidKeyStore_Password_Internal" -keypass "$AndroidKeyStore_Password_Internal"'
# - build_job # - rm "$(pwd)/fabaccess.keystore"
# artifacts:
# expire_in: 1 week
# paths:
# - '$env:ANDROID_RELEASE_FOLDER'
deploy_Android_alpha: #deploy_Android_alpha:
variables: # variables:
LC_ALL: 'en_US.UTF-8' # LC_ALL: 'en_US.UTF-8'
LANG: 'en_US.UTF-8' # LANG: 'en_US.UTF-8'
only: # only:
- alpha # - alpha
needs: # needs:
- build_Android # - build_Android
stage: deploy # stage: deploy
image: registry.gitlab.com/fabinfra/gtk-sharp-build:latest # image: registry.gitlab.com/fabinfra/gtk-sharp-build:latest
tags: # tags:
- docker # - docker
before_script: # before_script:
- 'echo $play_store_credentials > play-store-credentials.json' # - 'echo $play_store_credentials > play-store-credentials.json'
script: # script:
- 'bundle install' # - 'bundle install'
- 'bundle exec fastlane supply --aab Borepin/Borepin.Android/bin/Release/org.fab_infra.fabaccess-Signed.aab --track internal' # - 'bundle exec fastlane supply --aab Borepin/Borepin.Android/bin/Release/org.fab_infra.fabaccess-Signed.aab --track internal'
after_script: # after_script:
- 'rm play-store-credentials.json' # - 'rm play-store-credentials.json'
dependencies: # dependencies:
- build_Android # - build_Android
deploy_Android_beta: #deploy_Android_beta:
variables: # variables:
LC_ALL: 'en_US.UTF-8' # LC_ALL: 'en_US.UTF-8'
LANG: 'en_US.UTF-8' # LANG: 'en_US.UTF-8'
only: # only:
- beta # - beta
needs: # needs:
- build_Android # - build_Android
stage: deploy # stage: deploy
image: registry.gitlab.com/fabinfra/gtk-sharp-build:latest # image: registry.gitlab.com/fabinfra/gtk-sharp-build:latest
tags: # tags:
- docker # - docker
before_script: # before_script:
- 'echo $play_store_credentials > play-store-credentials.json' # - 'echo $play_store_credentials > play-store-credentials.json'
script: # script:
- 'bundle install' # - 'bundle install'
- 'bundle exec fastlane supply --aab Borepin/Borepin.Android/bin/Release/org.fab_infra.fabaccess-Signed.aab --track beta' # - 'bundle exec fastlane supply --aab Borepin/Borepin.Android/bin/Release/org.fab_infra.fabaccess-Signed.aab --track beta'
after_script: # after_script:
- 'rm play-store-credentials.json' # - 'rm play-store-credentials.json'
dependencies: # dependencies:
- build_Android # - build_Android
deploy_iOS: #deploy_iOS:
variables: # variables:
LC_ALL: 'en_US.UTF-8' # LC_ALL: 'en_US.UTF-8'
LANG: 'en_US.UTF-8' # LANG: 'en_US.UTF-8'
only: # only:
- alpha # - alpha
- feature/fastlane # - feature/fastlane
needs: # needs:
- build_iOS # - build_iOS
stage: deploy # stage: deploy
tags: # tags:
- macos # - macos
before_script: # before_script:
- 'echo $app_store_credentials > app-store-credentials.json' # - 'echo $app_store_credentials > app-store-credentials.json'
- 'export PATH="/usr/local/opt/ruby/bin:$PATH"' # - 'export PATH="/usr/local/opt/ruby/bin:$PATH"'
script: # script:
- 'bundle install' # - 'bundle install'
- 'bundle exec fastlane pilot upload --api_key_path app-store-credentials.json --ipa Borepin/Borepin.iOS/bin/iPhone/Debug/Borepin.iOS.ipa' # - 'bundle exec fastlane pilot upload --api_key_path app-store-credentials.json --ipa Borepin/Borepin.iOS/bin/iPhone/Debug/Borepin.iOS.ipa'
after_script: # after_script:
- 'rm app-store-credentials.json' # - 'rm app-store-credentials.json'
dependencies: # dependencies:
- build_iOS # - build_iOS