Skip to content

Commit

Permalink
Github Actions (#266)
Browse files Browse the repository at this point in the history
  • Loading branch information
AllanWang authored Sep 12, 2021
1 parent 6406554 commit 639771b
Show file tree
Hide file tree
Showing 6 changed files with 69 additions and 1 deletion.
54 changes: 54 additions & 0 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Android CI

on:
push:
branches: [ '*' ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 100

- name: Fetch all tags
run: git fetch origin +refs/tags/*:refs/tags/*

- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: '11'
java-package: jdk
distribution: 'adopt'
cache: gradle

- name: Validate gradle wrapper
uses: gradle/wrapper-validation-action@v1

- name: Decrypt secret
if: ${{ false }}
run: |
gpg -d --passphrase "${{ secrets.KAU_TAR_SECRET }}" --batch "files/kau_github.tar.gpg" > "files/kau_github.tar"
tar xvf files/kau_github.tar -C files
- name: Checkout Gradle Build Cache
if: ${{ steps.self_hosted.outputs.FLAG != 'self-hosted' }}
uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
!~/.gradle/wrapper/dists/**/gradle*.zip
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
gradle-${{ runner.os }}-
- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Check and Test
run: ./gradlew spotlessCheck lintRelease testReleaseUnitTest
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ This library contains small helper functions used throughout almost all of my ot
KAU is available on JitPack

[![](https://jitpack.io/v/ca.allanwang/kau.svg)](https://jitpack.io/#ca.allanwang/kau)
[![Build Status](https://travis-ci.com/AllanWang/KAU.svg?branch=dev)](https://travis-ci.com/AllanWang/KAU)
[![Build Status](https://github.com/AllanWang/KAU/actions/workflows/android.yml/badge.svg?branch=dev)](https://github.com/AllanWang/KAU/actions/workflows/android.yml)
[![Crowdin](https://d322cqt584bo4o.cloudfront.net/kotlin-android-utils/localized.svg)](https://crowdin.com/project/kotlin-android-utils)
[![Awesome Kotlin Badge](https://kotlin.link/awesome-kotlin.svg)](https://github.com/KotlinBy/awesome-kotlin)
[![ZenHub](https://img.shields.io/badge/Shipping%20faster%20with-ZenHub-45529A.svg)](https://app.zenhub.com/workspace/o/allanwang/kau/boards)
Expand Down
2 changes: 2 additions & 0 deletions files/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ gplay-keys.json
kau.keystore
kau.properties
update-dev.sh
kau.tar
kau_github.tar
9 changes: 9 additions & 0 deletions files/github_actions.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env bash

# Add appropriate files for encryption
# https://docs.github.com/en/actions/reference/encrypted-secrets#limits-for-secrets

rm kau_github.tar.gpg
tar cvf kau_github.tar gplay-keys.json kau.keystore kau.properties
gpg --symmetric --cipher-algo AES256 kau_github.tar
rm kau_github.tar
Binary file added files/kau_github.tar.gpg
Binary file not shown.
3 changes: 3 additions & 0 deletions sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ android {
keyAlias releaseProps.getProperty('keyAlias')
keyPassword releaseProps.getProperty('keyPassword')
}
println("Added KAU release signing")
} else {
println("No KAU release signing found")
}

debug {
Expand Down

0 comments on commit 639771b

Please sign in to comment.