├── Dockerfile ├── LICENCE.md ├── README.md ├── action.yml └── entrypoint.sh /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM runmymind/docker-android-sdk:alpine-standalone 2 | 3 | LABEL "com.github.actions.name"="Gradle Android" 4 | LABEL "com.github.actions.description"="Run Android Gradle tasks" 5 | LABEL "com.github.actions.icon"="play" 6 | LABEL "com.github.actions.color"="green" 7 | 8 | LABEL "repository"="http://github.com/Raul6469/android-gradle-action" 9 | LABEL "homepage"="http://github.com/actions" 10 | LABEL "maintainer"="Raul6469 " 11 | 12 | ADD entrypoint.sh /entrypoint.sh 13 | 14 | RUN chmod +x /entrypoint.sh 15 | 16 | ENTRYPOINT [ "/entrypoint.sh" ] 17 | -------------------------------------------------------------------------------- /LICENCE.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Victor 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # android-gradle-action 2 | 3 | Run Android Gradle tasks with GitHub Actions. 4 | 5 | ## Note 6 | This action may not be required to run Android builds. 7 | 8 | Instead, you can simply try to execute the gradle wrapper in the GitHub action VM with : 9 | 10 | ```yaml 11 | - name: Run tests 12 | run: ./gradlew test 13 | ``` 14 | 15 | ## Example 16 | 17 | ```yaml 18 | name: CI 19 | 20 | on: [push] 21 | 22 | jobs: 23 | build: 24 | runs-on: ubuntu-latest 25 | 26 | steps: 27 | - uses: actions/checkout@v2 28 | 29 | - name: Run Gradle command 30 | uses: Raul6469/android-gradle-action@2.0.0 31 | with: 32 | # The gradle command you wish to run (required) 33 | # Here, `./gradlew test` will be run 34 | script: test 35 | 36 | # In some cases, you may need to provide 37 | # Android licence agreement id 38 | # You can find it on your own machine under `$ANDROID_HOME/license`, 39 | # and add the file content as a GitHub secret named `$ANDROID_LICENCE`. 40 | android-licence: ${{ secrets.ANDROID_LICENCE }} 41 | ``` 42 | -------------------------------------------------------------------------------- /action.yml: -------------------------------------------------------------------------------- 1 | name: 'Gradle Android' 2 | description: 'Run Android Gradle tasks' 3 | 4 | author: "Raul6469 " 5 | 6 | branding: 7 | color: green 8 | icon: play 9 | 10 | inputs: 11 | script: 12 | description: 'The ./gradlew command arguments' 13 | required: true 14 | android-licence: 15 | description: 'Your Android license agreement id' 16 | 17 | runs: 18 | using: 'docker' 19 | image: 'Dockerfile' 20 | args: 21 | - ${{ inputs.android-licence }} 22 | - ${{ inputs.script }} 23 | -------------------------------------------------------------------------------- /entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -l 2 | set -eu 3 | 4 | chmod +x ./gradlew 5 | 6 | if [ -n "$1" ]; then 7 | mkdir -p $ANDROID_HOME/licenses 8 | echo -e $1 >> $ANDROID_HOME/licenses/android-sdk-license 9 | echo $"\nLicences accepted" 10 | fi 11 | 12 | echo $"\n--> Running './gradlew $2'\n" 13 | 14 | sh -c "./gradlew $2" 15 | --------------------------------------------------------------------------------