Skip to content

Merge pull request #275 from xyoye/dev_4.2.0 #53

Merge pull request #275 from xyoye/dev_4.2.0

Merge pull request #275 from xyoye/dev_4.2.0 #53

Workflow file for this run

name: package beta
# 主分支提交代码时,构建最新测试包
on:
push:
branches:
- master
jobs:
package:
name: Generate Beta APK
runs-on: ubuntu-latest
steps:
# 1.拉取代码
- name: checkout source code
uses: actions/checkout@v2
# 2.配置JDK
- name: set up JDK
uses: actions/setup-java@v3
with:
java-version: 11
distribution: adopt
# 3.获取签名密钥
- name: decrypt key
run: |
gpg --quiet --batch --yes --decrypt \
--passphrase=${{ secrets.KEY_PASSPHRASE }} \
--output gradle/assemble/dandanplay.jks gradle/assemble/dandanplay.jks.gpg
# 4.配置构建类型
- name: setup build type
run: echo "BUILD_TYPE=beta" >> $GITHUB_ENV
# 5.构建安装包
- name: assemble apk
env:
KEYSTORE_PASS: ${{ secrets.KEYSTORE_PASS }}
ALIAS_NAME: ${{ secrets.ALIAS_NAME }}
ALIAS_PASS: ${{ secrets.ALIAS_PASS }}
run: chmod +x gradlew &&./gradlew clean assemble${{ env.BUILD_TYPE }} --stacktrace
# 6.配置构建版本
- name: setup build version
run: |
apk_version=`egrep -o "[0-9].[0-9].[0-9]" buildSrc/src/main/java/Versions.kt`
echo "BUILD_VERSION=$apk_version" >> $GITHUB_ENV
# 7.移动文件到根目录
- name: move file
run: |
abis=(arm64-v8a armeabi-v7a universal)
for abi in ${abis[@]}
do
file_name="dandanplay_v${{ env.BUILD_VERSION }}_${abi}-${{ env.BUILD_TYPE }}.apk"
mv app/build/outputs/apk/${{ env.BUILD_TYPE }}/${file_name} $file_name
done
# 8.创建Release
- name: generate release
id: generate_release
uses: softprops/action-gh-release@v1
with:
name: 弹弹play概念版 v${{ env.BUILD_VERSION }} Beta
tag_name: dandanplay-v${{ env.BUILD_VERSION }}-beta
body: 最新测试包,与主分支代码同步
prerelease: true
files: |
dandanplay_v${{ env.BUILD_VERSION }}_arm64-v8a-${{ env.BUILD_TYPE }}.apk
dandanplay_v${{ env.BUILD_VERSION }}_armeabi-v7a-${{ env.BUILD_TYPE }}.apk
dandanplay_v${{ env.BUILD_VERSION }}_universal-${{ env.BUILD_TYPE }}.apk
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}