This repository has been archived by the owner on Jan 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 570
88 lines (86 loc) · 2.97 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
name: Core
on:
push:
branches:
- master
paths-ignore:
- '**/README.md'
workflow_dispatch:
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: |
mkdir -p ~/.gradle/wrapper
mkdir -p ~/.gradle/caches
[ $(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"