Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/xdtianyu/actions-android-ci
https://github.com/xdtianyu/actions-android-ci
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/xdtianyu/actions-android-ci
- Owner: xdtianyu
- Created: 2019-08-21T06:23:08.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2020-10-20T08:14:57.000Z (about 4 years ago)
- Last Synced: 2024-09-12T01:51:54.119Z (2 months ago)
- Language: Shell
- Size: 24.4 KB
- Stars: 23
- Watchers: 4
- Forks: 11
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Actions-Android-CI
Run Android build with GitHub Actions, checkout [xdtianyu/CallerInfo](https://github.com/xdtianyu/CallerInfo/blob/master/.github/workflows/android.yml) for more usage.
### Usage example
This example configure can build android app in ~2min with gradle and sdk cache.
![](https://raw.githubusercontent.com/xdtianyu/actions-android-ci/master/art/screenshot.png)
```yaml
name: Android CIon: [push]
jobs:
build:runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1- name: Checkout submodule
run: git submodule sync --recursive && git submodule update --init --recursive- name: Before build
uses: xdtianyu/actions-android-ci@master
env:
ENCRYPTED_KEY: ${{ secrets.ENCRYPTED_KEY }}
ENCRYPTED_IV: ${{ secrets.ENCRYPTED_IV }}
with:
args: '"
. ./env.sh;
openssl aes-256-cbc -K $ENCRYPTED_KEY -iv $ENCRYPTED_IV -in secrets.tar.enc -out secrets.tar -d;
tar xvf secrets.tar;
touch local.properties
"'- name: Cache gradle and sdk
uses: actions/cache@v2
env:
cache-name: cache-gradle-and-sdk
with:
path: |
${{ github.workspace }}/.opt/cache/gradle/wrapper
${{ github.workspace }}/.opt/cache/gradle/caches
${{ github.workspace }}/.opt/sdk
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/wrapper/gradle-wrapper.properties', '**/build.gradle') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-- name: Build
uses: xdtianyu/actions-android-ci@master
env:
ENCRYPTED_KEY: ${{ secrets.ENCRYPTED_KEY }}
ENCRYPTED_IV: ${{ secrets.ENCRYPTED_IV }}
ALIAS: ${{ secrets.ALIAS }}
ALIAS_PASSWORD: ${{ secrets.ALIAS_PASSWORD }}
KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
with:
args: '"
umask 000;
. ./env.sh;
. /opt/setup-android-sdk.sh;
./gradlew assembleRelease
"'- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: artifacts
path: |
app/**/apk/release/*
app/**/mapping/release/mapping.txt```