Skip to content

Commit

Permalink
chore: Add a debug build for Android APK.
Browse files Browse the repository at this point in the history
  • Loading branch information
iphydf committed Dec 1, 2024
1 parent 75eda96 commit ac8676b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 13 deletions.
27 changes: 16 additions & 11 deletions .github/workflows/build-test-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -108,40 +108,45 @@ jobs:
strategy:
matrix:
arch: [arm64-v8a]
build_type: [Release]
build_type: [Debug, Release]
include:
- build_type: Debug
artifact_type: debug
- build_type: Release
artifact_type: release
steps:
- uses: actions/checkout@v4
- name: Install docker-compose
run: sudo apt-get install -y docker-compose
- name: Run build
run: docker-compose run --rm android_builder.${{ matrix.arch }} ./android/cross-compile/build.sh --arch ${{ matrix.arch }} --build-type ${{ matrix.build_type }}
run: docker-compose run --rm android_builder.${{ matrix.arch }}.${{ matrix.artifact_type }} ./android/cross-compile/build.sh --arch ${{ matrix.arch }} --build-type ${{ matrix.build_type }}
- name: Upload Android apk
uses: actions/upload-artifact@v4
with:
name: qTox-${{ github.sha }}.${{ matrix.arch }}.apk
path: _build/android-build/build/outputs/apk/release/android-build-release-signed.apk
path: _build/android-build/build/outputs/apk/${{ matrix.artifact_type }}/android-build-${{ matrix.artifact_type }}-signed.apk
- name: Get tag name for Android release file name
if: contains(github.ref, 'refs/tags/v')
if: contains(github.ref, 'refs/tags/v') && matrix.artifact_type == 'release'
id: get_version
run: echo ::set-output name=VERSION::$(echo $GITHUB_REF | cut -d / -f 3)
- name: Rename Android APK for release upload
if: contains(github.ref, 'refs/tags/v')
run: |
cp _build/android-build/build/outputs/apk/release/android-build-release-signed.apk qTox-${{ steps.get_version.outputs.VERSION }}.${{ matrix.arch }}.apk
sha256sum qTox-${{ steps.get_version.outputs.VERSION }}.${{ matrix.arch }}.apk > qTox-${{ steps.get_version.outputs.VERSION }}.${{ matrix.arch }}.apk.sha256
cp _build/android-build/build/outputs/apk/${{ matrix.artifact_type }}/android-build-${{ matrix.artifact_type }}-signed.apk qTox-${{ steps.get_version.outputs.VERSION }}-${{ matrix.arch }}-${{ matrix.artifact_type }}.apk
sha256sum qTox-${{ steps.get_version.outputs.VERSION }}-${{ matrix.arch }}-${{ matrix.artifact_type }}.apk > qTox-${{ steps.get_version.outputs.VERSION }}-${{ matrix.arch }}-${{ matrix.artifact_type }}.apk.sha256
- name: Upload to versioned release
if: contains(github.ref, 'refs/tags/v')
if: contains(github.ref, 'refs/tags/v') && matrix.artifact_type == 'release'
uses: ncipollo/release-action@v1
with:
allowUpdates: true
draft: true
token: ${{ secrets.GITHUB_TOKEN }}
artifacts: "qTox-${{ steps.get_version.outputs.VERSION }}.${{ matrix.arch }}.apk,qTox-${{ steps.get_version.outputs.VERSION }}.${{ matrix.arch }}.apk.sha256"
artifacts: "qTox-${{ steps.get_version.outputs.VERSION }}-${{ matrix.arch }}-${{ matrix.artifact_type }}.apk,qTox-${{ steps.get_version.outputs.VERSION }}-${{ matrix.arch }}-${{ matrix.artifact_type }}.apk.sha256"
- name: Rename Android APK for nightly upload
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
run: |
cp _build/android-build/build/outputs/apk/release/android-build-release-signed.apk qTox-nightly.${{ matrix.arch }}.apk
sha256sum qTox-nightly.${{ matrix.arch }}.apk > qTox-nightly.${{ matrix.arch }}.apk.sha256
cp _build/android-build/build/outputs/apk/${{ matrix.artifact_type }}/android-build-${{ matrix.artifact_type }}-signed.apk qTox-nightly-${{ matrix.arch }}-${{ matrix.artifact_type }}.apk
sha256sum qTox-nightly-${{ matrix.arch }}-${{ matrix.artifact_type }}.apk > qTox-nightly-${{ matrix.arch }}-${{ matrix.artifact_type }}.apk.sha256
- name: Upload to nightly release
uses: ncipollo/release-action@v1
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
Expand All @@ -153,7 +158,7 @@ jobs:
prerelease: true
replacesArtifacts: true
token: ${{ secrets.GITHUB_TOKEN }}
artifacts: "qTox-nightly.${{ matrix.arch }}.apk,qTox-nightly.${{ matrix.arch }}.apk.sha256"
artifacts: "qTox-nightly-${{ matrix.arch }}-${{ matrix.artifact_type }}.apk,qTox-nightly-${{ matrix.arch }}-${{ matrix.artifact_type }}.apk.sha256"

build-flatpak:
name: Flatpak
Expand Down
7 changes: 5 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,11 @@ services:
alpine:
image: toxchat/qtox:alpine
<<: *shared_params
android_builder.arm64-v8a:
image: toxchat/qtox:android-builder
android_builder.arm64-v8a.debug:
image: toxchat/qtox:android-builder.arm64-v8a.debug
<<: *shared_params
android_builder.arm64-v8a.release:
image: toxchat/qtox:android-builder.arm64-v8a.release
<<: *shared_params
debian:
image: toxchat/qtox:debian
Expand Down

0 comments on commit ac8676b

Please sign in to comment.