You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
48 lines
1.2 KiB
48 lines
1.2 KiB
name: Android CI
|
|
|
|
on:
|
|
release:
|
|
types: [published]
|
|
push:
|
|
branches:
|
|
- master
|
|
|
|
jobs:
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: set up JDK 1.8
|
|
uses: actions/setup-java@v2
|
|
with:
|
|
java-version: '1.8'
|
|
distribution: 'adopt'
|
|
|
|
# 获取打包秘钥
|
|
- name: Checkout Android Keystore
|
|
uses: actions/checkout@v2
|
|
with:
|
|
repository: 存储android打包用的key的仓库(格式:用户名/仓库名)
|
|
token: ${{ secrets.TOKEN }} # 连接仓库的token,需要单独配置
|
|
path: keystore # 仓库的根目录名
|
|
# 打包release
|
|
- name: Build with Gradle
|
|
run: bash ./gradlew assembleRelease
|
|
# 创建release
|
|
- name: Create Release
|
|
id: create_release
|
|
uses: actions/create-release@v1
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
tag_name: v${{ github.ref }}
|
|
release_name: FYReader_v${{ github.ref }}
|
|
draft: false
|
|
prerelease: false
|
|
|
|
- name: Grant execute permission for gradlew
|
|
run: chmod +x gradlew
|
|
- name: Build with Gradle
|
|
run: ./gradlew build
|
|
|