diff --git a/.github/workflows/PR_check.yml b/.github/workflows/PR_check.yml new file mode 100644 index 0000000..0b1b034 --- /dev/null +++ b/.github/workflows/PR_check.yml @@ -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}'`" + + diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5b4ac60..d6bf55a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,8 +1,6 @@ on: push: branches: [ master ] - pull_request: - branches: [ master ] jobs: build: