subsurface/.github/workflows/android.yml
Dirk Hohndel e26dd30165 remove references to the test branch
This was useful as it helped to more quickly iterate through tests, but long term
isn't what we want.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2023-12-07 18:10:32 -08:00

64 lines
2.1 KiB
YAML

name: Android
on:
push:
branches:
- master
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
# only publish a 'release' on push events (those include merging a PR)
- name: upload binaries
if: github.event_name == 'push'
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: |
Subsurface-mobile*.apk