Release SDK #105
Workflow file for this run
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: Release SDK | |
on: | |
release: | |
types: | |
- created | |
jobs: | |
assemble: | |
name: Build | |
runs-on: ubuntu-latest | |
container: | |
image: openjdk:8-jdk | |
defaults: | |
run: | |
shell: bash | |
steps: | |
- name: Checkout github repo | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 1 | |
- name: Checkout LFS objects | |
run: | | |
apt update | |
apt -y install git-lfs | |
git lfs install --local | |
git lfs fetch | |
git lfs checkout | |
- name: set environment | |
run: | | |
apt -y install ant | |
apt -y install apg | |
apt -y install dos2unix | |
apt -y install autoconf | |
apt -y install automake | |
apt -y install g++ | |
apt -y install libtool | |
apt -y install patch | |
apt -y install make | |
apt -y install cmake | |
apt -y install ninja-build | |
apt -y install swig | |
apt -y install tclsh | |
apt -y install zip | |
apt -y install python3-pip | |
pip3 install -U pip setuptools | |
pip3 install conan==1.59.0 | |
echo "ANDROID_COMPILE_SDK=29" >> $GITHUB_ENV | |
echo "ANDROID_BUILD_TOOLS=29.0.3" >> $GITHUB_ENV | |
echo "ANDROID_SDK_TOOLS=4333796" >> $GITHUB_ENV | |
echo "NDK_VERSION=12b" >> $GITHUB_ENV | |
- name: set up Android SDK | |
run: | | |
wget --quiet --tries=0 --output-document=android-sdk.zip https://dl.google.com/android/repository/sdk-tools-linux-${ANDROID_SDK_TOOLS}.zip; | |
unzip -qq -d android-sdk-linux android-sdk.zip; | |
mkdir -p ~/.android; | |
touch ~/.android/repositories.cfg; | |
echo y | android-sdk-linux/tools/bin/sdkmanager "platforms;android-${ANDROID_COMPILE_SDK}" >/dev/null; | |
echo y | android-sdk-linux/tools/bin/sdkmanager "platform-tools" >/dev/null; | |
echo y | android-sdk-linux/tools/bin/sdkmanager "build-tools;${ANDROID_BUILD_TOOLS}" >/dev/null; | |
echo "ANDROID_HOME=$PWD/android-sdk-linux" >> $GITHUB_ENV | |
echo "$PWD/android-sdk-linux/platform-tools/" >> $GITHUB_PATH | |
set +o pipefail | |
yes | android-sdk-linux/tools/bin/sdkmanager --licenses | |
set -o pipefail | |
- name: set up Android NDK | |
run: | | |
wget --quiet --tries=0 --output-document=android-ndk.zip https://dl.google.com/android/repository/android-ndk-r${NDK_VERSION}-linux-x86_64.zip; | |
unzip -qq android-ndk.zip; | |
echo "ANDROID_NDK_HOME=$PWD/android-ndk-r${NDK_VERSION}" >> $GITHUB_ENV | |
echo "ANDROID_NDK=$PWD/android-ndk-r${NDK_VERSION}" >> $GITHUB_ENV | |
- name: build dependencies | |
run: | | |
git submodule update --init --recursive | |
pushd . | |
cd scripts | |
bash ./prebuild.sh | |
popd | |
cd takthirdparty | |
rm -rf distfiles ; \ | |
for i in builds/* ; do \ | |
pushd $i ; \ | |
(find * -type d -not -name "include" -not -path "include/*" -not -name "java" -not -name "lib" -not -path "lib/ogdi" -print0 | xargs -0 -I {} rm -rf {}) ; \ | |
(find . -maxdepth 1 -type f -print0 | xargs -0 -I {} rm -f {}) ; \ | |
(cd lib && (find . -maxdepth 1 -type f -not -name "*.so" -print0 | xargs -0 -I {} rm -f {})) ; \ | |
popd ; \ | |
done | |
- name: set up CMake | |
run: | | |
wget --quiet --tries=0 --output-document=cmake-3.14.7.tar.gz https://cmake.org/files/v3.14/cmake-3.14.7-Linux-x86_64.tar.gz; | |
gzip -d cmake-3.14.7.tar.gz; | |
tar xf cmake-3.14.7.tar; | |
rm -rf cmake-3.14.7.tar; | |
echo "CMAKE_HOME=$PWD/cmake-3.14.7-Linux-x86_64" >> $GITHUB_ENV | |
- name: install ATAK SDK keystore | |
env: | |
ANDROID_KEYSTORE_FILE: ${{ secrets.SDK_KEYSTORE_FILE }} | |
ANDROID_KEYSTORE_ALIAS: ${{ secrets.SDK_KEYSTORE_ALIAS }} | |
ANDROID_KEYSTORE_STORE_PASSWORD: ${{ secrets.SDK_KEYSTORE_STORE_PASSWORD }} | |
ANDROID_KEYSTORE_KEY_PASSWORD: ${{ secrets.SDK_KEYSTORE_KEY_PASSWORD }} | |
run: | | |
rm -rf $HOME/secrets | |
mkdir $HOME/secrets | |
echo "$ANDROID_KEYSTORE_FILE" > $HOME/secrets/sdk_keystore.base64 | |
base64 -d $HOME/secrets/sdk_keystore.base64 > $HOME/secrets/sdk_keystore | |
cd atak | |
rm -rf local.properties | |
echo "takDebugKeyFile=$HOME/secrets/sdk_keystore" >> local.properties | |
echo "takDebugKeyFilePassword=$ANDROID_KEYSTORE_STORE_PASSWORD" >> local.properties | |
echo "takDebugKeyAlias=$ANDROID_KEYSTORE_ALIAS" >> local.properties | |
echo "takDebugKeyPassword=$ANDROID_KEYSTORE_KEY_PASSWORD" >> local.properties | |
echo "takReleaseKeyFile=$HOME/secrets/sdk_keystore" >> local.properties | |
echo "takReleaseKeyFilePassword=$ANDROID_KEYSTORE_STORE_PASSWORD" >> local.properties | |
echo "takReleaseKeyAlias=$ANDROID_KEYSTORE_ALIAS" >> local.properties | |
echo "takReleaseKeyPassword=$ANDROID_KEYSTORE_KEY_PASSWORD" >> local.properties | |
- name: assemble ATAK APK | |
run: | | |
cd atak | |
echo "cmake.dir=$CMAKE_HOME" >> local.properties | |
echo "ndk.dir=$ANDROID_NDK" >> local.properties | |
rm -rf ATAK/app/build | |
bash ./gradlew generateJniHeaders | |
bash ./gradlew assembleCivSdk | |
- name: generate ATAK CIV SDK package | |
run: | | |
rm -rf takthirdparty | |
rm -rf takengine | |
rm -rf pluginsdk/ | |
unzip -qq pluginsdk.zip | |
cp ./atak/ATAK/app/build/outputs/apk/civ/sdk/*-sdk.apk ./pluginsdk/atak.apk | |
cp ./atak/ATAK/app/build/libs/main.jar ./pluginsdk | |
cp ./atak/ATAK/app/src/main/assets/support/license/LICENSE.txt ./pluginsdk | |
cp -r ./plugin-examples ./pluginsdk/ | |
echo "ATAK CIV SDK `git rev-parse --short HEAD` (`git show -s --format=%ct`)" > pluginsdk/VERSION.txt | |
rm -rf javadoc | |
mkdir -p tmp/src | |
cp -R ./atak/ATAK/app/src/common/java/* tmp/src | |
cp -R ./atak/ATAK/app/src/main/java/* tmp/src | |
pushd . | |
cd tmp/src && javadoc -linkoffline http://d.android.com/reference file://$ANDROID_HOME/docs/reference -d ../javadoc -classpath .:$ANDROID_HOME/platforms/android-${ANDROID_COMPILE_SDK}/android.jar -subpackages . &> /dev/null || echo "success by failure" | |
popd | |
pushd . | |
cd tmp/javadoc && jar cvf ../../pluginsdk/atak-javadoc.jar . | |
popd | |
pushd . | |
cd atak-gradle-takdev | |
chmod 755 gradlew | |
dos2unix gradlew | |
./gradlew jar | |
cp ./build/libs/atak-gradle-takdev-*.jar ../pluginsdk/atak-gradle-takdev.jar | |
popd | |
mv pluginsdk atak-civ | |
zip -qq -r atak-civ-sdk-${{ github.event.release.tag_name }}.zip atak-civ | |
rm -rf atak-civ | |
- name: publish ATAK SDK release artifact | |
uses: actions/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ github.event.release.upload_url }} | |
asset_path: atak-civ-sdk-${{ github.event.release.tag_name }}.zip | |
asset_name: atak-civ-sdk-${{ github.event.release.tag_name }}.zip | |
asset_content_type: binary/octet-stream |