-
Notifications
You must be signed in to change notification settings - Fork 133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
godot 4.3 project does not include keystore/... lines in export_presets.cfg, breaking example android export #161
Comments
adding the following to the setup stage "fixes the issue", but is very hacky. echo 'keystore/release=""' >> export_presets.cfg
echo 'keystore/release_user=""' >> export_presets.cfg
echo 'keystore/release_password=""' >> export_presets.cfg |
I now understand why these lines are missing: this sensitive data has been moved to .godot/export_credentials.cfg in some godot update (4.1?) Not sure if there is a way to generate this file. Edit: you can generate this file and build your Android project with Github Actions with the following workflow: name: "godot-ci export"
on: push
env:
GODOT_VERSION: 4.3
EXPORT_NAME: export-name
jobs:
export-android:
name: Android Export
runs-on: ubuntu-20.04
container:
image: barichello/godot-ci:4.3
steps:
- name: Checkout
uses: actions/checkout@v4
with:
lfs: true
- name: Setup
run: |
mkdir -v -p ~/.local/share/godot/export_templates/
mkdir -v -p ~/.config/
mv /root/.config/godot ~/.config/godot
mv /root/.local/share/godot/export_templates/${GODOT_VERSION}.stable ~/.local/share/godot/export_templates/${GODOT_VERSION}.stable
- name: generate export credentials
run: |
echo "generating export_credentials file"
mkdir .godot
echo ${{ secrets.SECRET_RELEASE_KEYSTORE_BASE64 }} | base64 --decode > /root/release.keystore
for num in $(grep -B3 'platform="Android"' export_presets.cfg | grep 'preset\.' | cut -d'.' -f2 | tr -d '[]'); do
echo "generating for preset number: $num"
echo "[preset.$num]" >> .godot/export_credentials.cfg
echo "[preset.$num.options]" >> .godot/export_credentials.cfg
echo "keystore/release=\"/root/release.keystore\"" >> .godot/export_credentials.cfg
echo "keystore/release_user=\"${{ secrets.SECRET_RELEASE_KEYSTORE_USER }}\"" >> .godot/export_credentials.cfg
echo "keystore/release_password=\"${{ secrets.SECRET_RELEASE_KEYSTORE_PASSWORD }}\"" >> .godot/export_credentials.cfg
done
echo "generated export credentials:"
cat .godot/export_credentials.cfg
- name: Android Build
run: |
mkdir -v -p build/android
godot --headless --verbose --export-release "Android" "build/android/$EXPORT_NAME.apk"
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: android
path: build/android maybe something like this could be added to the included example file? |
I switched from using the export config to using environment variables for android. so in my gitlab ci yml, im doing the following android:
stage: export
rules:
- if: $SECRET_RELEASE_KEYSTORE_USER
- if: $SECRET_RELEASE_KEYSTORE_PASSWORD
script:
- echo $SECRET_RELEASE_KEYSTORE_BASE64 | base64 --decode > /root/release.keystore
- export GODOT_ANDROID_KEYSTORE_RELEASE_PATH=/root/release.keystore
- export GODOT_ANDROID_KEYSTORE_RELEASE_USER=$SECRET_RELEASE_KEYSTORE_USER
- export GODOT_ANDROID_KEYSTORE_RELEASE_PASSWORD=$SECRET_RELEASE_KEYSTORE_PASSWORD
- sed 's@version/code=".*"@version/code='$CI_PIPELINE_IID'@g' -i export_presets.cfg
- sed 's@version/name=".*"@version/name="'$CI_COMMIT_SHORT_SHA'"@g' -i export_presets.cfg
- godot --headless --verbose --export-release "Android" ./build/android/$EXPORT_NAME.apk
artifacts:
name: $EXPORT_NAME-$CI_JOB_NAME
paths:
- build/android
tags:
- godot i'm having a different issue where it says theres a configuration error, but doesnt print what the error is. I don't think its related to the keystore, because i get the same error whether or not I use the old method or this one. |
... wow. I totally missed that those exist, that seems way easier.
have you tried removing those |
Oh, I managed to fix it. I don't fully understand sed, so my edits most likely were putting quotes around something that didn't need them. |
the example gitlab-ci.yml file expects keystore/... lines to exist in the export_presets.cfg, but they do not in a new godot 4.3 project
gitlab-ci.yml lines in question:
I ported this to github actions and it works fine if I append the following to my android release in my export_presets.cfg:
but this gets overwritten anytime I change something about my export presets from godot, so these lines go missing again, breaking the android export. What would be the best way to add these lines to the file if they are missing?
my export job for android for github actions looks something like this:
The text was updated successfully, but these errors were encountered: