Skip to content

Commit

Permalink
Add Github Actions to build the apk
Browse files Browse the repository at this point in the history
  • Loading branch information
saidinesh5 committed Dec 9, 2023
1 parent 04bb960 commit 08d2d29
Showing 1 changed file with 59 additions and 0 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Android CI

on:
push:
branches: [ "master", "whisper" ]
pull_request:
branches: [ "master", "whisper" ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: gradle
- uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew build && mkdir -p releases && mv app/build/outputs/apk/release/app-release.apk releases/com.elishaazaria.sayboard_$GITHUB_RUN_ID.apk

- name: Upload Apk to Nightly Repository
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
uses: wlixcc/[email protected]
with:
username: 'drone'
server: 'volla.tech'
port: 22
ssh_private_key: '${{ secrets.FDROID_DEPLOY_KEY }}'
local_path: './releases/*.apk'
remote_path: '/fdroid-nightly.volla.tech/builds/volla/Sayboard/'
args: '-o CheckHostIP=no -o StrictHostKeyChecking=no'

- name: Upload Apk to Release Repository
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
uses: wlixcc/[email protected]
with:
username: 'drone'
server: 'volla.tech'
port: 22
ssh_private_key: '${{ secrets.FDROID_DEPLOY_KEY }}'
local_path: './releases/*.apk'
remote_path: '/fdroid.volla.tech/builds/volla/Sayboard/'
args: '-o CheckHostIP=no -o StrictHostKeyChecking=no'

0 comments on commit 08d2d29

Please sign in to comment.