tools for exporting godot projects via Github Actions
my rebase accidentally removed this but i dont want to amend becauase then it will ping all those issues all over again
bendn 2022-12-05
parent 0d6ec3c · commit 8ac0072
-rw-r--r--.github/actions/export-android/action.yml15
-rw-r--r--.github/actions/export/action.yml10
-rw-r--r--.github/actions/get-export-name/action.yml2
-rw-r--r--.github/actions/itch-push/action.yml5
-rw-r--r--.github/actions/setup-godot/action.yml1
5 files changed, 15 insertions, 18 deletions
diff --git a/.github/actions/export-android/action.yml b/.github/actions/export-android/action.yml
index d510dd6..698587e 100644
--- a/.github/actions/export-android/action.yml
+++ b/.github/actions/export-android/action.yml
@@ -22,13 +22,13 @@ runs:
export ANDROID_HOME="/usr/lib/android-sdk"
export PATH="${ANDROID_HOME}/cmdline-tools/cmdline-tools/bin:${PATH}"
if [[ ! -d ${ANDROID_HOME}/cmdline-tools ]]; then
- echo "::group::Downloading Android SDKs"
+ echo "::group::Download Android SDKs"
mkdir -p ${ANDROID_HOME}/cmdline-tools
keytool -keyalg RSA -genkeypair -alias androiddebugkey -keypass android -keystore /root/debug.keystore -storepass android -dname "CN=Android Debug,O=Android,C=US" -validity 9999
- wget -nv https://dl.google.com/android/repository/commandlinetools-linux-7583922_latest.zip -O ~/tools.zip
- unzip ~/tools.zip -d ${ANDROID_HOME}/cmdline-tools && rm ~/tools.zip && echo "Finished unzipping"
- yes | sdkmanager --licenses > /dev/null && echo "Accepted licenses"
- sdkmanager "platform-tools" "build-tools;30.0.3" "platforms;android-29" "cmdline-tools;latest" "cmake;3.10.2.4988404" "ndk;21.4.7075529" && echo "Installed Android SDKs"
+ wget -q https://dl.google.com/android/repository/commandlinetools-linux-9123335_latest.zip -O ~/tools.zip
+ unzip -q ~/tools.zip -d ${ANDROID_HOME}/cmdline-tools && rm ~/tools.zip && echo "Installed command line tools"
+ yes | sdkmanager --licenses >/dev/null && echo "Accepted licenses"
+ sdkmanager "platform-tools" "build-tools;30.0.3" "platforms;android-29" "cmdline-tools;latest" "cmake;3.10.2.4988404" "ndk;21.4.7075529" >/dev/null && echo "Installed Android SDKs"
echo "::endgroup::"
fi
shell: bash
@@ -36,11 +36,12 @@ runs:
- name: Prep build
if: inputs.android-keystore-base64
run: |
+ echo "::group::Prep build"
password="${{ inputs.android-password }}"
- echo "::group::Build android (release)"
echo "${{ inputs.android-keystore-base64 }}" | base64 --decode > ~/release.keystore && echo "Decoded keystore"
- alias=$(keytool -storepass "$password" -list -v -keystore ~/release.keystore | grep -E '^Alias name:\s*(.+)$' | cut -d ' ' -f 3-) && echo "Got alias name"
+ alias="$(keytool -storepass "$password" -list -v -keystore ~/release.keystore | grep -E '^Alias name:\s*(.+)$' | cut -d ' ' -f 3-)" && echo "Got alias name"
sed "s@keystore/release=\"\"@keystore/release=\"$HOME/release.keystore\"@g" -i export_presets.cfg && sed 's@keystore/release_user=".*"@keystore/release_user="'$alias'"@g' -i export_presets.cfg && sed 's@keystore/release_password=".*"@keystore/release_password="'$password'"@g' -i export_presets.cfg && echo "Configured export_presets.cfg"
+ echo "::endgroup::"
shell: bash
- name: Build
diff --git a/.github/actions/export/action.yml b/.github/actions/export/action.yml
index 4c3bd67..6627e2a 100644
--- a/.github/actions/export/action.yml
+++ b/.github/actions/export/action.yml
@@ -9,9 +9,9 @@ inputs:
description: File extension (x86_64, exe, etc)
required: true
debug:
- description: Debug build or no (non empty string = true)
+ description: Debug build or no (empty string = debug)
required: false
- default: ""
+ default: "false"
name:
description: The name ($name.exe) # defaults to $NAME
required: false
@@ -34,10 +34,10 @@ runs:
echo "::group::${p^} Build"
export="--export"
[[ ${GODOT_VERSION:0:1} -gt 3 ]] && export="--export-release"
- [[ -n $debug ]] && export="--export-debug"
+ [[ -z $debug ]] && export="--export-debug"
mkdir -vp build/${{ inputs.platform }}
- n="$NAME"
- [[ -z "${{ inputs.name}}" ]] && n="${{ inputs.name }}"
+ n="${{ env.NAME }}"
+ [[ -n "${{ inputs.name }}" ]] && n="${{ inputs.name }}"
godot -v --headless --path "${{ env.PROJECT_PATH }}" "$export" "${{ steps.n.outputs.export-name }}" "./build/${{ inputs.platform }}/$n.${{ inputs.extension }}"
echo "::endgroup::"
diff --git a/.github/actions/get-export-name/action.yml b/.github/actions/get-export-name/action.yml
index c3b413a..2cec900 100644
--- a/.github/actions/get-export-name/action.yml
+++ b/.github/actions/get-export-name/action.yml
@@ -19,7 +19,7 @@ runs:
run: |
cd "${{ env.PROJECT_PATH }}"
wget -nv 'https://raw.githubusercontent.com/bend-n/godot-actions/main/.github/actions/get-export-name/get-export-name.py' -O get-export-name.py
- python get-export-name.py "${GODOT_VERSION:0:1}" "${{ inputs.platform }}" || (
+ python get-export-name.py "${GODOT_VERSION:0:1}" "${{ inputs.platform }}" >/dev/null || (
echo "::error file=${PROJECT_PATH}/export_presets.cfg,title=Missing Configuration::No export for ${{ inputs.platform }}."
exit 1
)
diff --git a/.github/actions/itch-push/action.yml b/.github/actions/itch-push/action.yml
index b1e3d57..18f2346 100644
--- a/.github/actions/itch-push/action.yml
+++ b/.github/actions/itch-push/action.yml
@@ -8,7 +8,6 @@ inputs:
itch-path:
description: "The path to the itch.io project eg: leafo/x-moon"
required: false
- default: ""
runs:
using: composite
@@ -30,9 +29,7 @@ runs:
echo "::endgroup::"
}
push "web"; push "linux"; push "windows";
- [[ -d mac ]] && unzip "mac/${{ env.NAME }}.zip" -d mac/ \
- && rm "mac/${{ env.NAME }}.zip" \
- && echo -e '#!/bin/bash\ncd "$(dirname "$0")";\nxattr -cr "$(pwd)/${{ env.NAME }}.app";\nopen -n -a "$(pwd)/${{ env.NAME }}.app"' >./mac/run.sh \
+ [[ -d mac ]] && echo -e '#!/bin/bash\ncd "$(dirname "$0")";\nxattr -cr "$(pwd)/${{ env.NAME }}.app";\nopen -n -a "$(pwd)/${{ env.NAME }}.app"' >./mac/run.sh \
&& push "mac"
[[ -d android ]] && rm android/*.idsig && push "android"
env:
diff --git a/.github/actions/setup-godot/action.yml b/.github/actions/setup-godot/action.yml
index b5902e3..00c837b 100644
--- a/.github/actions/setup-godot/action.yml
+++ b/.github/actions/setup-godot/action.yml
@@ -24,7 +24,6 @@ runs:
uses: actions/setup-python@v4
with:
python-version: "3.9"
- cache: pip
- name: Setup godot
if: steps.clean.outputs.clean == 'true'