add: PR check
This commit is contained in:
parent
ca3701497f
commit
a08a24a0f7
2 changed files with 49 additions and 2 deletions
49
.github/workflows/PR_check.yml
vendored
Normal file
49
.github/workflows/PR_check.yml
vendored
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
on: pull_request
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build on ${{ matrix.os }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ ubuntu-latest ]
|
||||
if: ${{ !startsWith(github.event.head_commit.message, 'docs:') }}
|
||||
|
||||
steps:
|
||||
- name: Check out
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: 'recursive'
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Gradle wrapper validation
|
||||
uses: gradle/wrapper-validation-action@v1
|
||||
|
||||
- name: Set up JDK 11
|
||||
uses: actions/setup-java@v1
|
||||
with:
|
||||
java-version: '11'
|
||||
|
||||
- name: Creat key
|
||||
run: |
|
||||
PASSWD=$(echo $RANDOM | md5sum | head -c 15)
|
||||
keytool -genkey -noprompt -v -keystore android.keystore -alias PRCHECKSIGN -keyalg RSA -keysize 2048 -validity 10000 -keypass ${PASSWD} -storepass ${PASSWD} -dname "CN=xx, OU=xx, O=xx, L=xx, S=xx, C=xx"
|
||||
echo storePassword="${PASSWD}" >> local.properties
|
||||
echo keyAlias="PRCHECKSIGN" >> local.properties
|
||||
echo keyPassword="${PASSWD}" >> local.properties
|
||||
echo fileDir='../android.keystore' >> local.properties
|
||||
|
||||
- name: Make gradlew executable
|
||||
run: chmod +x ./gradlew
|
||||
|
||||
- name: Gradle prebuild
|
||||
run: ./gradlew prebuild
|
||||
|
||||
- name: Build Release
|
||||
id: buildRelease
|
||||
run: |
|
||||
./gradlew :app:assembleRelease
|
||||
echo "::set-output name=releaseName::`ls app/build/outputs/apk/release/V*-release.apk | awk -F '(/|.apk)' '{print $6}'`"
|
||||
|
||||
|
||||
2
.github/workflows/main.yml
vendored
2
.github/workflows/main.yml
vendored
|
|
@ -1,8 +1,6 @@
|
|||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
|
|
|||
Reference in a new issue