Frontier-of-Hell/.gitlab-ci.yml

116 lines
2.7 KiB
YAML
Raw Normal View History

2023-10-20 10:36:17 +02:00
image: barichello/godot-ci:4.1.2
# Cache imported assets between runs
cache:
key: import-assets
paths:
- .godot/imported/
stages:
- import-assets
- export
- deploy
variables:
EXPORT_NAME: Frontier-of-Hell
# Open the editor to import assets in case the cache was empty or outdated
import-assets:
stage: import-assets
script:
- godot -v -e --quit --headless
linux:
stage: export
script:
- mkdir -v -p build/linux
- godot -v --export-release --headless "Linux/X11" ../build/linux/$EXPORT_NAME.x86_64
artifacts:
name: $EXPORT_NAME-$CI_JOB_NAME
paths:
- build/linux
windows:
stage: export
script:
- mkdir -v -p build/windows
- godot -v --export-release --headless "Windows Desktop" ../build/windows/$EXPORT_NAME.exe
artifacts:
name: $EXPORT_NAME-$CI_JOB_NAME
paths:
- build/windows
mac:
stage: export
script:
- mkdir -v -p build/mac
- godot -v --export-release --headless "Mac OSX" ../build/mac/$EXPORT_NAME.zip
artifacts:
name: $EXPORT_NAME-$CI_JOB_NAME
paths:
- build/mac
web:
stage: export
script:
- mkdir -v -p build/web
- godot -v --export-release --headless "HTML5" ../build/web/index.html
artifacts:
name: $EXPORT_NAME-$CI_JOB_NAME
paths:
- build/web
android:
stage: export
2023-10-20 11:01:49 +02:00
rules:
- if: $SECRET_RELEASE_KEYSTORE_BASE64
- if: $SECRET_RELEASE_KEYSTORE_USER
- if: $SECRET_RELEASE_KEYSTORE_PASSWORD
2023-10-20 10:36:17 +02:00
script:
2023-10-20 11:01:49 +02:00
- echo $SECRET_RELEASE_KEYSTORE_BASE64 | base64 --decode > /root/upload-keystore.jks
2023-10-20 10:36:17 +02:00
- mkdir -v -p build/android
2023-10-20 11:01:49 +02:00
- sed 's@keystore/release=".*"@keystore/release="'/root/upload-keystore.jks'"@g' -i export_presets.cfg
- sed 's@keystore/release_user=".*"@keystore/release_user="'$SECRET_RELEASE_KEYSTORE_USER'"@g' -i export_presets.cfg
- sed 's@keystore/release_password=".*"@keystore/release_password="'$SECRET_RELEASE_KEYSTORE_PASSWORD'"@g' -i export_presets.cfg
- godot -v --export-release --headless "Android" ../build/android/$EXPORT_NAME.apk
2023-10-20 10:36:17 +02:00
artifacts:
name: $EXPORT_NAME-$CI_JOB_NAME
paths:
2023-10-20 11:01:49 +02:00
- build/android
# GitLab Pages Deploy
pages:
stage: deploy
dependencies:
- web
script:
# This ensures the `pages` branch is available.
- git fetch
- git checkout pages
- rm -f *.md
- mv build/web/** ./public
artifacts:
paths:
- public
# Itch.io Deploy
itchio:linux:
stage: deploy
script:
- butler push ./build/linux $ITCHIO_USERNAME/$ITCHIO_GAME:linux
dependencies:
- linux
itchio:windows:
stage: deploy
script:
- butler push ./build/windows $ITCHIO_USERNAME/$ITCHIO_GAME:windows
dependencies:
- windows
itchio:macosx:
stage: deploy
script:
- butler push ./build/mac $ITCHIO_USERNAME/$ITCHIO_GAME:mac
dependencies:
- mac