From a98eb19aff511928d68b40e028f44741a0899a0e Mon Sep 17 00:00:00 2001 From: DarthBenro008 Date: Fri, 21 Aug 2020 18:48:23 +0530 Subject: [PATCH] feat: Chat ID addition --- Dockerfile | 7 ++++--- action.yml | 25 ++++++++++++------------- entrypoint.sh | 6 ++++++ 3 files changed, 22 insertions(+), 16 deletions(-) diff --git a/Dockerfile b/Dockerfile index ad49374..bd65526 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,13 +1,14 @@ FROM openjdk:8 +RUN apt-get install curl ARG ANDROID_SDK_VERSION=6609375 ENV ANDROID_SDK_ROOT /opt/android-sdk RUN mkdir -p ${ANDROID_SDK_ROOT}/cmdline-tools && \ wget -q https://dl.google.com/android/repository/commandlinetools-linux-${ANDROID_SDK_VERSION}_latest.zip && \ unzip *tools*linux*.zip -d ${ANDROID_SDK_ROOT}/cmdline-tools && \ - rm *tools*linux*.zip + rm *tools*linux*.zip COPY license_accepter.sh /opt/ -RUN chmod +x /opt/license_accepter.sh && /opt/license_accepter.sh $ANDROID_SDK_ROOT +RUN chmod +x /opt/license_accepter.sh && /opt/license_accepter.sh $ANDROID_SDK_ROOT ADD entrypoint.sh /entrypoint.sh RUN chmod +x /entrypoint.sh -ENTRYPOINT ["/entrypoint.sh"] +ENTRYPOINT ["/entrypoint.sh"] \ No newline at end of file diff --git a/action.yml b/action.yml index 9a26d16..fd125fa 100644 --- a/action.yml +++ b/action.yml @@ -2,22 +2,21 @@ name: "AppBrickie" description: "To Test and Build a Debug Android App" author: "hkpdev008@gmail.com" -jobs: - generate-apk: - name: Build Debug Apk - runs-on: ubuntu-18.04 +inputs: + chatid: + description: "The Place to send the App" + requried: true - steps: - - uses: actions/checkout@v2 - - name: Upload APK - uses: actions/upload-artifact@v2 - with: - name: app - path: app/build/outputs/apk/debug/app-debug.apk +outputs: + result: + description: "Result of automated send" runs: - using: "docker" - image: "Dockerfile" + using: "docker" + image: "Dockerfile" + args: + - ${{inputs.chatid}} + branding: icon: "play-circle" color: "gray-dark" diff --git a/entrypoint.sh b/entrypoint.sh index b207d4c..ed64750 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,3 +1,9 @@ #!/bin/sh -l bash ./gradlew test --stacktrace bash ./gradlew assembleDebug --stacktrace +echo $1 +output=$(curl --location --request POST 'http://appbrickie.herokuapp.com/api/sendPackage' \ + --form 'file=@app/build/outputs/apk/debug/app-debug.apk' \ + --form 'id='$1'' \ + --form 'msg=Automated File!') +echo "::set-output name=result::$output"