feedback #121
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
name: CD | |
# Controls when the workflow will run | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
workflow_dispatch: | |
create: | |
jobs: | |
build-android: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write # for softprops/action-gh-release to create GitHub release | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install NDK | |
run: echo "y" | sudo ${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager --install "ndk;19.2.5345600" "tools" "build-tools;30.0.3" "platforms;android-30" | |
- run: git clone https://github.com/benibela/xidel.git | |
- run: xidel/.github/download-dependencies.sh && xidel/.github/setup-fpc-cfg.sh | |
- name: Install FreePascal for Android | |
run: | | |
oldpath=$PWD; | |
sudo -E $oldpath/android/manage.sh setupbinutils /usr/bin | |
sudo apt-get update | |
sudo apt-get install fpc | |
git clone https://gitlab.com/freepascal.org/fpc/source/ --depth 1 --single-branch -b fixes_3_2 fpc | |
cd fpc | |
git apply -v $oldpath/patches/fpc*patch | |
sudo $oldpath/android/manage.sh setupfpccrosscompile | |
cd $oldpath; | |
android/manage.sh setupfpccrosscfg >> ~/.fpc.cfg | |
- name: Setup signing | |
run: | | |
mkdir -p ~/.gradle | |
base64 -d <<<$KEYSTORE > /tmp/keystore | |
echo 'ANDROID_STORE_PASSWORD='$KEYSTORE_PASS > ~/.gradle/gradle.properties | |
echo 'ANDROID_KEY_PASSWORD='$KEYSTORE_PASS >> ~/.gradle/gradle.properties | |
echo 'ANDROID_GLOBAL_KEYSTORE=/tmp/keystore' >> ~/.gradle/gradle.properties | |
env: | |
KEYSTORE: ${{ secrets.KEYSTORE }} | |
KEYSTORE_PASS: ${{ secrets.KEYSTORE_PASS }} | |
- name: Build VideLibri | |
run: | | |
#config | |
echo "'gh'" > videlibribuildid.inc | |
#Disable PasDblStrUtils | |
sed -e '/PASDBL/d' -i internettools/internettoolsconfig.inc | |
#Set additional path | |
echo -Fi$PWD/internettools/data >> ~/.fpc.cfg | |
echo -Fu$PWD/internettools/data >> ~/.fpc.cfg | |
echo -Fu$PWD/internettools/internet >> ~/.fpc.cfg | |
echo -Fu$PWD/internettools/system >> ~/.fpc.cfg | |
#fix binutils | |
which i686-linux-android-strip | |
which aarch64-linux-android-strip | |
which arm-linux-androideabi-strip | |
which x86_64-linux-android-strip | |
newestToolchain=$(echo /usr/local/lib/android/sdk/ndk/*/toolchains/llvm/prebuilt/linux-x86_64/bin/ | tr ' ' '\n' | sort | tail -1) | |
echo Newest toolchain: $newestToolchain | |
sudo ln -srfv $(which i686-linux-android-strip) $newestToolchain/ | |
sudo ln -srfv $(which aarch64-linux-android-strip) $newestToolchain/ | |
sudo ln -srfv $(which arm-linux-androideabi-strip) $newestToolchain/ | |
sudo ln -srfv $(which x86_64-linux-android-strip) $newestToolchain/ | |
#Start building | |
cd android | |
./manage.sh build release | |
./manage.sh symbols | |
- name: 'Upload ' | |
uses: actions/upload-artifact@v3 | |
with: | |
name: videlibri.apk | |
path: android/android/build/outputs/apk/release/android-release.apk | |
- name: 'Upload ' | |
uses: actions/upload-artifact@v3 | |
with: | |
name: videlibri.aab | |
path: android/android/build/outputs/bundle/release/android-release.aab | |
- name: 'Upload ' | |
uses: actions/upload-artifact@v3 | |
with: | |
name: android-symbols | |
path: android/symbols/ | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
files: | | |
android/android/build/outputs/apk/release/android-release.apk | |
android/android/build/outputs/bundle/release/android-release.aab |