构建缓存,极速编译

* 默认用的jdk11,不用设置jdk了
* 引入actions/cache@v2加快编译速度
pull/849/head
10bits 4 years ago committed by GitHub
parent fa727896de
commit 73a327b398
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 22
      .github/workflows/legado.yml

@ -31,10 +31,15 @@ jobs:
UPLOAD_ARTIFACT: 'true'
steps:
- uses: actions/checkout@v2
- name: Set Up JDK
uses: actions/setup-java@v1
- uses: actions/cache@v2
with:
java-version: 14
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-legado-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-legado-
- name: Clear 18PlusList.txt
run: |
echo "清空18PlusList.txt"
@ -43,10 +48,11 @@ jobs:
run: |
echo "给apk增加签名"
cp $GITHUB_WORKSPACE/.github/workflows/legado.jks $GITHUB_WORKSPACE/app/legado.jks
sed '$a\RELEASE_STORE_FILE=./legado.jks' $GITHUB_WORKSPACE/gradle.properties -i
sed '$a\RELEASE_KEY_ALIAS=legado' $GITHUB_WORKSPACE/gradle.properties -i
sed '$a\RELEASE_STORE_PASSWORD=gedoor_legado' $GITHUB_WORKSPACE/gradle.properties -i
sed '$a\RELEASE_KEY_PASSWORD=gedoor_legado' $GITHUB_WORKSPACE/gradle.properties -i
sed -e '$a\RELEASE_STORE_FILE=./legado.jks' \
-e '$a\RELEASE_KEY_ALIAS=legado' \
-e '$a\RELEASE_STORE_PASSWORD=gedoor_legado' \
-e '$a\RELEASE_KEY_PASSWORD=gedoor_legado' \
$GITHUB_WORKSPACE/gradle.properties -i
- name: Apk Live Together
run: |
echo "设置apk共存"
@ -56,7 +62,7 @@ jobs:
run: |
echo "开始进行release构建"
chmod +x gradlew
./gradlew assembleAppRelease
./gradlew assembleAppRelease --build-cache --parallel
- name: Upload App To Artifact
if: ${{ env.UPLOAD_ARTIFACT != 'false' }}
uses: actions/upload-artifact@v2

Loading…
Cancel
Save