This repository has been archived on 2025-12-04. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
HMAL-OSS-old/.github/workflows/PR_check.yml
2021-07-13 16:55:28 +08:00

49 lines
1.5 KiB
YAML

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}'`"