-
-
Notifications
You must be signed in to change notification settings - Fork 54
197 lines (176 loc) · 6.38 KB
/
maven_debug_package.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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
name: Maven DEBUG Package CI
on:
push:
pull_request:
release:
types: [published, edited]
workflow_dispatch:
inputs:
version:
description: dummy
default: dummy
jobs:
build-debug:
runs-on: ubuntu-20.04
permissions:
contents: write
steps:
- name: freespace_1
run: |
df -h
# - name: Maximize build space
# uses: easimon/maximize-build-space@master
# with:
# root-reserve-mb: 512
# swap-size-mb: 1024
# remove-dotnet: 'true'
- name: freespace_2
run: |
df -h
- name: Checkout
uses: actions/checkout@v4
- name: install basic android SDK
run: |
sudo apt update && \
sudo DEBIAN_FRONTEND=noninteractive apt install -y --no-install-recommends \
android-sdk \
lsb-release \
clang \
cmake \
libconfig-dev \
libgtest-dev \
ninja-build \
pkg-config \
zip grep file ca-certificates autotools-dev autoconf automake \
git bc wget rsync cmake make pkg-config libtool \
ssh gzip tar \
coreutils \
curl \
libncurses5 \
wget \
git \
curl \
software-properties-common \
unzip \
zip \
automake \
autotools-dev \
build-essential \
check \
checkinstall \
libtool \
libfreetype6-dev \
fontconfig-config \
libfontconfig1-dev \
pkg-config \
openjdk-8-jdk
- name: Install NDK
run: |
echo ${ANDROID_SDK_ROOT}
# find / -name sdkmanager 2>/dev/null
ls -al /usr/local/lib/android/sdk/cmdline-tools/latest/bin/sdkmanager
echo "y" | sudo /usr/local/lib/android/sdk/cmdline-tools/latest/bin/sdkmanager --install "ndk;21.0.6113669" --sdk_root=${ANDROID_SDK_ROOT}
echo "y" | sudo /usr/local/lib/android/sdk/cmdline-tools/latest/bin/sdkmanager --install "ndk;20.1.5948944" --sdk_root=${ANDROID_SDK_ROOT}
# sdkmanager --update
# sdkmanager 'cmdline-tools;latest'
# sdkmanager --uninstall 'cmdline-tools;1.0'
- name: pkgs
run: |
sudo apt update && \
sudo DEBIAN_FRONTEND=noninteractive apt install -y --no-install-recommends \
clang \
cmake \
libconfig-dev \
libgtest-dev \
ninja-build \
pkg-config \
zip grep file ca-certificates autotools-dev autoconf automake \
git bc wget rsync cmake make pkg-config libtool \
ssh gzip tar \
coreutils \
libncurses5
- name: use mnt dir
run: |
sudo mkdir -p /root/work/
sudo mv -v /root/work /mnt/
sudo ls -al /mnt
sudo bash -c "cd /root/ ; ln -s /mnt/work; ls -al"
- name: move_source
run: |
sudo mkdir -p /root/work/jni-c-toxcore/
sudo cp -av /home/runner/work/ToxAndroidRefImpl/ToxAndroidRefImpl/jni-c-toxcore/* /root/work/jni-c-toxcore/
sudo mkdir -p /root/work/android-refimpl-app/
sudo cp -av /home/runner/work/ToxAndroidRefImpl/ToxAndroidRefImpl/android-refimpl-app/* /root/work/android-refimpl-app/
# sudo git clone https://github.com/zoff99/ToxAndroidRefImpl /root/work/trifa_master_src
# sudo mkdir -p /root/work/android-refimpl-app/app/
# sudo cp -av /root/work/trifa_master_src/android-refimpl-app/app/* /root/work/android-refimpl-app/app/
- name: check java versions installed
run: |
echo $JAVA_HOME||echo "NO ERR"
sudo rm -Rf /usr/lib/jvm/temurin-11-jdk-amd64
sudo rm -Rf /usr/bin/java /bin/java
dpkg -l|grep -i jdk
dpkg -l|grep -i java
- name: set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
# distribution: 'temurin'
- name: check java versions installed
run: |
echo $JAVA_HOME||echo "NO ERR"
type -a java
- name: freespace_3
run: |
df -h
- name: build_maven_deps
run: |
export JAVA_HOME=/opt/hostedtoolcache/jdk/8.0.422/x64
java -version
sudo mkdir -p ~/work/deploy
sudo mkdir -p ~/.android/
sudo touch ~/.android/debug.keystore
sudo mkdir -p build_dir
sudo mkdir -p /home/runner/work/ToxAndroidRefImpl/ToxAndroidRefImpl/build_dir
pwd
ls -al
sudo bash -c "export JAVA_HOME=/opt/hostedtoolcache/jdk/8.0.422/x64;cd /home/runner/work/ToxAndroidRefImpl/ToxAndroidRefImpl/build_dir/;../circle_scripts/deps.sh debugbuild"
- name: build_maven_pkg
run: |
pwd
export JAVA_HOME=/opt/hostedtoolcache/jdk/8.0.422/x64
sudo bash -c "cp -av /home/runner/work/ToxAndroidRefImpl/ToxAndroidRefImpl/stub* /root/work/"
sudo bash -c "export JAVA_HOME=/opt/hostedtoolcache/jdk/8.0.422/x64;cd /home/runner/work/ToxAndroidRefImpl/ToxAndroidRefImpl/build_dir/;../circle_scripts/trifa.sh '../'"
- name: acls_maven_pkg
run: |
sudo chmod -R a+rx /root/work/artefacts/
sudo ls -al /root/work/artefacts/
sudo bash -c 'cp -av /root/work/artefacts/*.zip /home/runner/work/'
- name: get arm64 lib only
run: |
ls -al
pwd
cp -v /home/runner/work/local_maven.zip .
mkdir unpack
cd unpack/
pwd
ls -al /home/runner/work/
unzip /home/runner/work/local_maven.zip
unzip root/.m2/repository/com/zoffcc/applications/trifajni/trifa-jni-lib/*/trifa-jni-lib-*.aar
ls -hal jni/arm64-v8a/libjni-c-toxcore.so
cp -v jni/arm64-v8a/libjni-c-toxcore.so ../libjni-c-toxcore.so___arm64_debug
- name: rename file to debug
run: |
mv -v local_maven.zip local_maven_debug.zip
- name: Upload to nightly release
uses: ncipollo/release-action@v1
if: github.ref == 'refs/heads/zoff99/maven_artefact'
with:
allowUpdates: true
tag: nightly
omitBodyDuringUpdate: true
omitNameDuringUpdate: true
prerelease: true
replacesArtifacts: true
token: ${{ secrets.GITHUB_TOKEN }}
artifacts: "local_maven_debug.zip,libjni-c-toxcore.so___arm64_debug"