2019-10-18 16:32:38 +00:00
|
|
|
name: Android
|
2019-10-26 01:04:01 +00:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
2023-12-07 05:55:12 +00:00
|
|
|
- github-action-test
|
2019-10-26 01:04:01 +00:00
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- master
|
2019-10-18 16:32:38 +00:00
|
|
|
|
|
|
|
jobs:
|
2020-12-11 17:49:40 +00:00
|
|
|
buildAndroid:
|
2019-10-18 16:32:38 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
container:
|
2020-11-19 20:55:39 +00:00
|
|
|
image: docker://subsurface/android-build-container:5.15.1
|
2019-10-18 16:32:38 +00:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: checkout sources
|
|
|
|
uses: actions/checkout@v1
|
|
|
|
|
2023-12-07 05:55:12 +00:00
|
|
|
- name: create release name
|
|
|
|
id: tag
|
|
|
|
run: |
|
|
|
|
export tag=""
|
|
|
|
export is_latest=false
|
|
|
|
if [ "${{ github.ref_type }}" = "tag" ] ; then tag="${{ github.ref_name }}" ; else tag="latest"; is_latest=true ; fi
|
|
|
|
echo "tag=${tag}" >> $GITHUB_OUTPUT
|
|
|
|
echo "is_latest=${is_latest}" >> $GITHUB_OUTPUT
|
|
|
|
|
2019-10-18 16:32:38 +00:00
|
|
|
- name: run build
|
2023-12-07 05:55:12 +00:00
|
|
|
id: build
|
2022-05-13 18:33:05 +00:00
|
|
|
env:
|
|
|
|
SUBSURFACE_REPO_PATH: ${{ github.workspace }}
|
2019-10-18 16:32:38 +00:00
|
|
|
run: |
|
2020-11-19 20:55:39 +00:00
|
|
|
# this is rather awkward, but it allows us to use the preinstalled
|
|
|
|
# Android and Qt versions with relative paths
|
|
|
|
cd $GITHUB_WORKSPACE/..
|
|
|
|
ln -s /android/5.15.* .
|
|
|
|
ln -s /android/build-tools .
|
|
|
|
ln -s /android/cmdline-tools .
|
|
|
|
ln -s /android/ndk .
|
|
|
|
ln -s /android/platform-tools .
|
|
|
|
ln -s /android/platforms .
|
|
|
|
ln -s /android/tools .
|
2019-10-18 16:32:38 +00:00
|
|
|
ls -l
|
2020-12-03 18:49:15 +00:00
|
|
|
git config --global user.email "ci@subsurface-divelog.org"
|
|
|
|
git config --global user.name "Subsurface CI"
|
2020-12-11 00:32:02 +00:00
|
|
|
# it turns out our build container doesn't have a native compiler
|
|
|
|
# yet ECM needs that
|
|
|
|
apt-get install --reinstall cpp-7 gcc-7-base libgcc-7-dev libcc1-0 gcc-7
|
2022-05-13 18:33:05 +00:00
|
|
|
git config --global --add safe.directory ${SUBSURFACE_REPO_PATH}
|
|
|
|
git config --global --add safe.directory ${SUBSURFACE_REPO_PATH}/libdivecomputer
|
2020-11-19 20:55:39 +00:00
|
|
|
bash -x ./subsurface/packaging/android/qmake-build.sh
|
2019-10-18 16:32:38 +00:00
|
|
|
|
2023-12-07 05:55:12 +00:00
|
|
|
- name: upload binaries
|
|
|
|
uses: softprops/action-gh-release@v1
|
|
|
|
with:
|
|
|
|
tag_name: ${{ steps.tag.outputs.tag }}
|
|
|
|
prerelease: ${{ steps.tag.outputs.is_latest }}
|
|
|
|
body: CICD release artifact
|
|
|
|
fail_on_unmatched_files: false
|
|
|
|
files: |
|
2023-12-07 10:53:14 +00:00
|
|
|
Subsurface-mobile*.apk
|