-
Notifications
You must be signed in to change notification settings - Fork 5
92 lines (90 loc) · 3.59 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
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