Merge pull request #287 from 10bits/master

默认checkout本仓库最新代码构建,不再clone远端代码
pull/293/head
kunfei 4 years ago committed by GitHub
commit 7372d8bc0e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. BIN
      .github/workflows/legado.jks
  2. 39
      .github/workflows/legado.yml

Binary file not shown.

@ -8,6 +8,8 @@ on:
- '3.*'
watch:
types: [started]
schedule:
- cron: '0 4 * * *'
jobs:
build:
@ -20,32 +22,31 @@ jobs:
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: install git
- name: clear 18PlusList.txt
run: |
sudo apt-get update
sudo apt-get -y install git
- name: clone code
run: |
git clone https://github.com/gedoor/legado.git /opt/legado
echo "ojbk">/opt/legado/app/src/main/assets/18PlusList.txt
echo "清空18PlusList.txt"
echo "">$GITHUB_WORKSPACE/app/src/main/assets/18PlusList.txt
- name: release apk sign
run: |
git clone https://github.com/10bits/gedoor-Build.git /opt/gedoor-Build
cp /opt/gedoor-Build/.github/workflows/legado.jks /opt/legado/app/legado.jks
sed '$a\RELEASE_STORE_FILE=./legado.jks' /opt/legado/gradle.properties -i
sed '$a\RELEASE_KEY_ALIAS=legado' /opt/legado/gradle.properties -i
sed '$a\RELEASE_STORE_PASSWORD=gedoor_legado' /opt/legado/gradle.properties -i
sed '$a\RELEASE_KEY_PASSWORD=gedoor_legado' /opt/legado/gradle.properties -i
sed "s/'.release'/'.releaseA'/" /opt/legado/app/build.gradle -i
sed 's/.release/.releaseA/g' /opt/legado/app/google-services.json -i
- name: Build with Gradle
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
- name: apk live together
run: |
echo "设置apk共存"
sed "s/'.release'/'.releaseA'/" $GITHUB_WORKSPACE/app/build.gradle -i
sed 's/.release/.releaseA/' $GITHUB_WORKSPACE/app/google-services.json -i
- name: build with gradle
run: |
cd /opt/legado
echo "开始进行release构建"
chmod +x gradlew
./gradlew assembleRelease
./gradlew aR
- name : upload apk
uses: actions/upload-artifact@master
if: always()
with:
name: legado apk
path: /opt/legado/app/build/outputs/apk/app/release
path: ${{ github.workspace }}/app/build/outputs/apk/app/release

Loading…
Cancel
Save