Skip to content

Commit

Permalink
build: add github workflow for custom release builds
Browse files Browse the repository at this point in the history
  • Loading branch information
spwoodcock committed Mar 22, 2024
1 parent 706125d commit f4afced
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/custom_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Workflow to deploy custom builds on ODK Collect

name: 🔧 Build and Release

on:
release:
types: [published]
# Allow manual trigger (workflow_dispatch)
workflow_dispatch:

jobs:
build_upload_apk:
runs-on: ubuntu-latest
permissions:
contents: write

container:
image: docker.io/cimg/android:2023.10.1

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Add Robolectric Deps
run: ./download-robolectric-deps.sh

- name: Compile Code
run: ./gradlew assembleDebug

- name: Install Github CLI
run: |
sudo apt update
sudo apt install --no-install-recommends -y gh
- name: Build & Upload APK
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
./gradlew assembleSelfSignedRelease
apk_path=$(find ./collect_app/build/outputs/apk/selfSignedRelease -name '*.apk' -type f)
echo "Generated APK file: ${apk_path}"
gh release upload ${{ github.event.release.tag_name }} "${apk_path}"

0 comments on commit f4afced

Please sign in to comment.