Skip to content
This repository has been archived by the owner on Jan 8, 2024. It is now read-only.

Commit

Permalink
Github action
Browse files Browse the repository at this point in the history
  • Loading branch information
yujincheng08 authored and RikkaW committed Jul 12, 2021
1 parent 92f30fc commit fe5147a
Show file tree
Hide file tree
Showing 8 changed files with 97 additions and 5 deletions.
82 changes: 82 additions & 0 deletions .github/workflows/main.yml
@@ -0,0 +1,82 @@
name: Core

on:
push:

jobs:
build:
runs-on: ubuntu-20.04
if: ${{ !startsWith(github.event.head_commit.message, '[skip ci]') }}

steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: 'recursive'
fetch-depth: 0
- name: set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
- name: Cache Gradle Dependencies
uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
!~/.gradle/caches/build-cache-*
key: gradle-deps-core-${{ hashFiles('**/build.gradle') }}
restore-keys: |
gradle-deps
- name: Cache Gradle Build
uses: actions/cache@v2
with:
path: |
~/.gradle/caches/build-cache-*
key: gradle-builds-core-${{ github.sha }}
restore-keys: |
gradle-builds
- name: Cache Ccache
uses: actions/cache@v2
with:
path: ~/.ccache
key: ccache-cache-${{ github.sha }}
restore-keys: ccache-cache-
- name: Install ccache
run: |
sudo apt-get install -y ccache
ccache -o max_size=2G
ccache -o hash_dir=false
- name: Build with Gradle
run: |
[ $(du -s ~/.gradle/wrapper | awk '{ print $1 }') -gt 250000 ] && rm -rf ~/.gradle/wrapper/* || true
find ~/.gradle/caches -exec touch -d "2 days ago" {} + || true
echo 'org.gradle.caching=true' >> gradle.properties
echo 'org.gradle.parallel=true' >> gradle.properties
echo 'org.gradle.vfs.watch=true' >> gradle.properties
echo 'org.gradle.jvmargs=-Xmx2048m' >> gradle.properties
./gradlew zipDebug zipRelease
- name: Prepare artifact
if: success()
id: prepareArtifact
run: |
releaseName=`ls out/riru-*-release.zip | awk -F '(/|.zip)' '{print $2}'` && echo "::set-output name=releaseName::$releaseName"
debugName=`ls out/riru-*-debug.zip | awk -F '(/|.zip)' '{print $2}'` && echo "::set-output name=debugName::$debugName"
unzip out/riru-*-release.zip -d riru-release
unzip out/riru-*-debug.zip -d riru-debug
- name: Upload release
uses: actions/upload-artifact@v2
with:
name: ${{ steps.prepareArtifact.outputs.releaseName }}
path: './riru-release/*'
- name: Upload debug
# if: ${{ github.event_name == 'pull_request' && success() }}
uses: actions/upload-artifact@v2
with:
name: ${{ steps.prepareArtifact.outputs.debugName }}
path: './riru-debug/*'
- name: Upload mappings
uses: actions/upload-artifact@v2
with:
name: mappings
path: "riru/build/outputs/mapping/release"
2 changes: 1 addition & 1 deletion app/build.gradle
Expand Up @@ -23,7 +23,7 @@ android {
}
buildTypes {
debug {
signingConfig signingConfigs.sign
signingConfig signingConfigs.debug
}
release {
signingConfig signingConfigs.sign
Expand Down
3 changes: 3 additions & 0 deletions build.gradle
Expand Up @@ -27,6 +27,9 @@ allprojects {
repositories {
google()
mavenCentral()
maven {
url "https://s01.oss.sonatype.org/content/repositories/releases/"
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Expand Up @@ -16,4 +16,4 @@ org.gradle.jvmargs=-Xmx1536m
# https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true
# https://github.com/google/prefab/issues/122
android.prefabVersion=1.1.2
android.prefabVersion=1.1.2
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
#Sat Sep 12 17:22:17 CST 2020
#Mon Jul 12 12:36:51 CST 2021
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
Empty file modified gradlew 100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion riru/build.gradle
Expand Up @@ -144,7 +144,7 @@ afterEvaluate {

def md = MessageDigest.getInstance("SHA-256")
f.file.eachByte 4096, { bytes, size ->
md.update(bytes, 0, size);
md.update(bytes, 0, size)
}
file(f.file.path + ".sha256sum").text = md.digest().encodeHex()
}
Expand Down
7 changes: 7 additions & 0 deletions riru/src/main/cpp/CMakeLists.txt
@@ -1,5 +1,12 @@
cmake_minimum_required(VERSION 3.4.1)

find_program(CCACHE ccache)

if (CCACHE)
set(CMAKE_CXX_COMPILER_LAUNCHER ${CCACHE})
set(CMAKE_C_COMPILER_LAUNCHER ${CCACHE})
endif ()

message("Build type: ${CMAKE_BUILD_TYPE}")

set(CMAKE_CXX_STANDARD 17)
Expand Down

0 comments on commit fe5147a

Please sign in to comment.