Adjust lights attenuation for new CGE #60
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ---------------------------------------------------------------------------- | |
# GitHub Action workflow to build using latest Castle Game Engine snapshot | |
# for multiple platforms. | |
# | |
# See https://castle-engine.io/github_actions . | |
# | |
# Modified the default template to build client and server for not-quake. | |
# ---------------------------------------------------------------------------- | |
name: Build | |
on: [push] | |
jobs: | |
# Build for platforms supported by | |
# CGE Docker image https://hub.docker.com/r/kambi/castle-engine-cloud-builds-tools/ . | |
# | |
# Since setting up Docker image takes majority of time (5-6 mins) | |
# compared to actually getting and compiling CGE (1 min) | |
# and building application (~1 min for each platform), | |
# we build all platforms possible within one job. | |
build-using-docker: | |
name: Build Using Docker | |
runs-on: ubuntu-latest | |
container: kambi/castle-engine-cloud-builds-tools:cge-unstable | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Package Windows Client | |
run: cd client/ && castle-engine package --os=win64 --cpu=x86_64 --verbose | |
- name: Package Windows Server | |
run: cd server/ && castle-engine package --os=win64 --cpu=x86_64 --verbose | |
- name: Archive Artifacts | |
# See https://github.com/actions/upload-artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: windows-build | |
path: | | |
client/*-win64-x86_64.zip | |
server/*-win64-x86_64.zip | |
if-no-files-found: error | |
- name: Package Linux Client | |
run: cd client/ && castle-engine package --os=linux --cpu=x86_64 --verbose | |
- name: Package Linux Server | |
run: cd server/ && castle-engine package --os=linux --cpu=x86_64 --verbose | |
- name: Archive Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: linux-build | |
path: | | |
client/*-linux-x86_64.tar.gz | |
server/*-linux-x86_64.tar.gz | |
if-no-files-found: error | |
- name: Unpack Android Secrets | |
env: | |
ANDROID_KEYSTORE: ${{ secrets.ANDROID_KEYSTORE }} | |
ANDROID_SIGNING_PROPERTIES: ${{ secrets.ANDROID_SIGNING_PROPERTIES }} | |
run: | | |
cd client | |
echo "$ANDROID_KEYSTORE" | base64 --decode > cge.keystore | |
echo "$ANDROID_SIGNING_PROPERTIES" | sed -e "s|WORKSPACE|${GITHUB_WORKSPACE}/client/|" - > AndroidSigningProperties.txt | |
- name: Package Android Client | |
run: cd client/ && castle-engine package --target=android --verbose | |
# We'd need some UI for Android server | |
# - name: Package Android Server | |
# run: cd server/ && castle-engine package --target=android --verbose | |
- name: Archive Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: android-build | |
path: | | |
client/*.apk | |
server/*.apk | |
if-no-files-found: error | |
# Build for platforms supported from macOS. | |
# This means to build for macOS and (maybe in the future) iOS. | |
build-macos: | |
name: Build Using macOS | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Install FPC+Lazarus | |
uses: gcarreno/setup-lazarus@v3.2.17 | |
with: | |
lazarus-version: stable | |
- name: Castle Game Engine - Env CASTLE_ENGINE_PATH | |
run: echo "CASTLE_ENGINE_PATH=$GITHUB_WORKSPACE/castle-engine" >> $GITHUB_ENV | |
- name: Castle Game Engine - Env PATH (non-Windows) | |
run: echo "PATH=$PATH:$CASTLE_ENGINE_PATH/tools/build-tool/" >> $GITHUB_ENV | |
- name: Castle Game Engine - Clone snapshot | |
run: git clone --depth 1 --single-branch --branch snapshot https://github.com/castle-engine/castle-engine/ | |
- name: Castle Game Engine - Build | |
run: cd $CASTLE_ENGINE_PATH/tools/build-tool/ && ./castle-engine_compile.sh | |
- name: Package macOS Client | |
run: cd client/ && castle-engine package --os=darwin --cpu=x86_64 --verbose | |
- name: Package macOS Server | |
run: cd server/ && castle-engine package --os=darwin --cpu=x86_64 --verbose | |
- name: Archive Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: macos-build | |
path: | | |
client/*-darwin-x86_64.zip | |
server/*-darwin-x86_64.zip | |
if-no-files-found: error | |
release: | |
name: Release | |
runs-on: ubuntu-latest | |
# Only upload release if all builds, on all runners, succeeded. | |
needs: [build-using-docker, build-macos] | |
steps: | |
- name: Download packaged releases | |
uses: actions/download-artifact@v4 | |
with: | |
merge-multiple: true | |
- name: List downloaded files | |
run: ls -R | |
- name: GH CLI status | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: gh auth status | |
# Releases files in the "snapshot" release. | |
- name: Release Artifacts | |
if: ${{ github.ref == 'refs/heads/master' }} | |
# Not uploading: client/*.apk | |
# because too much things don't work -- RNL cannot connect. | |
run: gh release --repo ${{ github.repository }} upload snapshot --clobber client/*.zip client/*.tar.gz server/*.zip server/*.tar.gz | |
env: | |
GH_TOKEN: ${{ github.token }} | |
update-release-tag: | |
name: Update Release Tag (make snapshot tag point to the build commit on master branch) | |
runs-on: ubuntu-latest | |
needs: [release] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Update Release Tag | |
if: ${{ github.ref == 'refs/heads/master' }} | |
run: | | |
# --force allows to overwrite previous tag | |
git tag --force snapshot | |
# --force allows to push with overwritten tag | |
git push --force origin snapshot |