release-4.1.0 #43
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |