Skip to content

move action

move action #1

Workflow file for this run

name: "Build and Upload to UBDiag"
description: "Build and Upload to UBDiag"
inputs:
projectKey:
type: string
required: true
app:
type: string
required: true
flavor:
type: string
required: true
appModule:
type: string
required: false
default: 'app'
self_hosted_cache_endpoint:
required: false
default: 'truenas.local.lan'
type: string
description: Should be set for selfhosted builds, but build won't fail without it
self_hosted_cache_port:
required: false
default: 9000
type: number
self_hosted_cache_bucket:
required: false
default: github-actions-cache
type: string
self_hosted_cache_region:
required: false
default: local
type: string
do_store_upload:
required: false
default: false
type: boolean
runs:
using: "composite"
steps:
# Checkout repository and submodules
- name: Checkout
uses: actions/[email protected]
with:
token: ${{ secrets.ANDROID_JENKINS_PAT }}
submodules: 'recursive'
lfs: 'true'
# Set build variables for reuse in multiple steps
- name: Set Build Variables
id: vars
shell: bash
run: |
flavor=${{ inputs.flavor }}
echo ::set-output name=build_uuid::$(cat /proc/sys/kernel/random/uuid)
echo ::set-output name=web_icon::${{ github.workspace }}/${{ inputs.appModule }}/tmp_icon_large_for_backend.png
echo ::set-output name=flavor_capitalized::${flavor~}
# Setup the build environment with Java 17 and the Zulu OpenJDK
- name: Setup Java
uses: actions/[email protected]
with:
distribution: 'zulu'
java-version: '17'
- name: Cache Maven packages on self-hosted MinIO
if: ${{ fromJSON(inputs.do_store_upload) == false }}
uses: tespkg/actions-cache@adf4e5e57e916ad83e63cc047ce271ef0843a24c
with:
endpoint: ${{ inputs.self_hosted_cache_endpoint }}
port: ${{ inputs.self_hosted_cache_port }}
insecure: true
accessKey: ${{ secrets.self_hosted_cache_access_key }}
secretKey: ${{ secrets.self_hosted_cache_secret_key }}
bucket: ${{ inputs.self_hosted_cache_bucket }}
region: ${{ inputs.self_hosted_cache_region }}
use-fallback: true
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-${{ inputs.projectKey }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-${{ inputs.projectKey }}-gradle-
# Setup the build environment with Gradle
- name: Setup Gradle
uses: gradle/[email protected]
with:
cache-disabled: true
# Assemble app
- name: Assemble app
shell: bash
run: ./gradlew :${{ inputs.appModule }}:assemble${{ steps.vars.outputs.flavor_capitalized }}Release
-PubiqueMavenUrl=${{ secrets.UB_ARTIFACTORY_URL_ANDROID }}
-PubiqueMavenUser=${{ secrets.UB_ARTIFACTORY_USERNAME }}
-PubiqueMavenPass=${{ secrets.UB_ARTIFACTORY_PASSWORD }}
-PubiquePoEditorAPIKey=${{ secrets.UBIQUE_POEDITOR_API_KEY }}
-Pbranch=${{ github.ref_name }}
-Pbuildnumber=${{ github.run_number }}
-Pubappid=${{ steps.vars.outputs.build_uuid }}
-Pwebicon=${{ steps.vars.outputs.web_icon }}
${{ secrets.ADDITIONAL_GRADLE_PROPS }}
# Upload to UBDiag
- name: Upload build to UBDiag
uses: UbiqueInnovation/[email protected]
with:
buildNumber: ${{ github.run_number }}
projectKey: ${{ inputs.projectKey }}
flavor: ${{ inputs.flavor }}
app: ${{ inputs.app }}
appModuleDirectory: './${{ inputs.appModule }}'
buildUuid: ${{ steps.vars.outputs.build_uuid }}
webIconFile: tmp_icon_large_for_backend.png
backendEndpoint: ${{ secrets.UBDIAG_UPLOAD_URL }}
self_hosted_cache_access_key: ${{ secrets.self_hosted_cache_access_key }}
self_hosted_cache_secret_key: ${{ secrets.self_hosted_cache_secret_key }}
# Setup the build environment with Gradle
- name: Publish the app
if: ${{ fromJSON(inputs.do_store_upload) }}
shell: bash
run: ./gradlew :${{ inputs.appModule }}:publish${{ steps.vars.outputs.flavor_capitalized }}ReleaseUploadBundle
env:
UPLOAD_KEY_STORE_PASSWORD: ${{ secrets.UPLOAD_KEY_STORE_PASSWORD }}
UPLOAD_KEY_PASSWORD: ${{ secrets.UPLOAD_KEY_PASSWORD }}
ANDROID_PUBLISHER_CREDENTIALS: ${{ secrets.ANDROID_PUBLISHER_CREDENTIALS }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}