mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 13:10:19 +00:00
cc5a5a22bd
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
65 lines
2.1 KiB
YAML
65 lines
2.1 KiB
YAML
name: Android
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
- github-action-test
|
|
pull_request:
|
|
branches:
|
|
- master
|
|
|
|
jobs:
|
|
buildAndroid:
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: docker://subsurface/android-build-container:5.15.1
|
|
|
|
steps:
|
|
- name: checkout sources
|
|
uses: actions/checkout@v1
|
|
|
|
- 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
|
|
|
|
- name: run build
|
|
id: build
|
|
env:
|
|
SUBSURFACE_REPO_PATH: ${{ github.workspace }}
|
|
run: |
|
|
# 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 .
|
|
ls -l
|
|
git config --global user.email "ci@subsurface-divelog.org"
|
|
git config --global user.name "Subsurface CI"
|
|
# 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
|
|
git config --global --add safe.directory ${SUBSURFACE_REPO_PATH}
|
|
git config --global --add safe.directory ${SUBSURFACE_REPO_PATH}/libdivecomputer
|
|
bash -x ./subsurface/packaging/android/qmake-build.sh
|
|
artifacts=$(find $(pwd) -name \*.apk)
|
|
echo "artifacts=$artifacts" >> $GITHUB_OUTPUT
|
|
|
|
- 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: |
|
|
${{ steps.build.ouputs.artifacts }}
|