add Android .apk to release from GitHub Action

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2023-12-07 14:55:12 +09:00
parent b0228b51ed
commit cc5a5a22bd
2 changed files with 22 additions and 1 deletions

View file

@ -3,6 +3,7 @@ on:
push: push:
branches: branches:
- master - master
- github-action-test
pull_request: pull_request:
branches: branches:
- master - master
@ -17,7 +18,17 @@ jobs:
- name: checkout sources - name: checkout sources
uses: actions/checkout@v1 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 - name: run build
id: build
env: env:
SUBSURFACE_REPO_PATH: ${{ github.workspace }} SUBSURFACE_REPO_PATH: ${{ github.workspace }}
run: | run: |
@ -40,4 +51,15 @@ jobs:
git config --global --add safe.directory ${SUBSURFACE_REPO_PATH} git config --global --add safe.directory ${SUBSURFACE_REPO_PATH}
git config --global --add safe.directory ${SUBSURFACE_REPO_PATH}/libdivecomputer git config --global --add safe.directory ${SUBSURFACE_REPO_PATH}/libdivecomputer
bash -x ./subsurface/packaging/android/qmake-build.sh 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 }}

View file

@ -3,7 +3,6 @@ on:
push: push:
branches: branches:
- master - master
- github-action-test
pull_request: pull_request:
branches: branches:
- master - master