Skip to content

DEVOPS-837: Jenkins 2 Actions #5

DEVOPS-837: Jenkins 2 Actions

DEVOPS-837: Jenkins 2 Actions #5

Workflow file for this run

name: Catroid CI
on:
push:
branches:
- "**"
pull_request:
branches:
- "**"
# schedule:
# - cron: "0 0 * * *" # Run daily at midnight
workflow_dispatch:
inputs:
WEB_TEST_URL:
description: "When set, all the archived APKs will point to this Catrobat web server, useful for testing web changes. E.g https://web-test.catrob.at"
required: false
type: string
default: ""
INCLUDE_HUAWEI_FILES:
description: "Embed any huawei files that are needed"
required: false
type: boolean
default: false
ANDROID_VERSION:
description: "The Android version to use for the build"
required: false
type: string
default: "33"
BUILD_ALL_FLAVOURS:
description: "When selected all flavours are built and archived as artifacts that can be installed alongside other versions of the same APKs"
required: false
type: boolean
default: false
jobs:
build:
runs-on: catrobat-runner-set
container:
image: catrobat/catrobat-android:api33
env:
ANDROID_VERSION: ${{ inputs.ANDROID_VERSION }}
WEB_TEST_URL: ${{ inputs.WEB_TEST_URL != '' && format('-PwebTestUrl=''{0}''', inputs.WEB_TEST_URL) || '' }}
ALL_FLAVOURS_PARAMETERS: ${{ inputs.BUILD_ALL_FLAVOURS && 'assembleCreateAtSchoolDebug assembleLunaAndCatDebug assemblePhiroDebug assembleEmbroideryDesignerDebug assemblePocketCodeBetaDebug assembleMindstormsDebug' || '' }}
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Include Huawei Files
if: ${{ inputs.INCLUDE_HUAWEI_FILES }}
run: cp /home/user/huawei/agconnect-services.json catroid/src/agconnect-services.json
- name: Build APK
run: ./gradlew ${{ env.WEB_TEST_URL }} -Pindependent='#${{ github.run_number }} ${{ github.ref_name }}' assembleCatroidDebug ${{ env.ALL_FLAVOURS_PARAMETERS }}
- name: Rename APKs
run: |
for file in $(find . -name "*.apk"); do
mv "$file" "$(dirname "$file")/${{ github.ref_name }}-${{ github.run_number }}-$(basename "$file")"
done
#- name: Archive APKs
# uses: actions/upload-artifact@v4
# with:
# name: apk-artifacts
# path: "**/*.apk"