Skip to content

DRO-708: implement network mode with websocket #115

DRO-708: implement network mode with websocket

DRO-708: implement network mode with websocket #115

name: Android Build
on:
push:
branches: [ main ]
tags:
- 'v*'
pull_request:
branches: [ main ]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
cache: gradle
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: |
if [[ "${GITHUB_REF_TYPE}" == "tag" && "${GITHUB_REF}" == refs/tags/v* ]]; then
VERSION_NAME="${GITHUB_REF#refs/tags/v}"
elif [[ "${GITHUB_REF_TYPE}" == "tag" && "${GITHUB_REF}" == refs/tags/* ]]; then
VERSION_NAME="${GITHUB_REF#refs/tags/}"
else
VERSION_NAME="${GITHUB_REF_NAME}"
fi
VERSION_CODE="${GITHUB_RUN_NUMBER}"
export VERSION_NAME
export VERSION_CODE
./gradlew assembleDebug --no-daemon
- name: Upload APK
uses: actions/upload-artifact@v4
with:
name: app-debug
path: app/build/outputs/apk/debug/app-debug.apk
release:
needs: build
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Download built APK
uses: actions/download-artifact@v4
with:
name: app-debug
path: artifacts
- name: Rename APK with version
run: |
TAG_NAME=${GITHUB_REF#refs/tags/}
mv artifacts/app-debug.apk "artifacts/droidrun-portal-${TAG_NAME}.apk"
- name: Create Release
uses: softprops/action-gh-release@v1
with:
files: artifacts/*.apk
draft: false
prerelease: false
generate_release_notes: true