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