构建缓存,极速编译

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

Loading…
Cancel
Save