2022-03-24 14:07:10 +00:00
|
|
|
|
name: Release
|
2021-11-22 08:23:56 +00:00
|
|
|
|
|
|
|
|
|
# 触发器
|
|
|
|
|
on:
|
|
|
|
|
push:
|
|
|
|
|
tags:
|
|
|
|
|
- v*
|
|
|
|
|
pull_request:
|
|
|
|
|
tags:
|
|
|
|
|
- v*
|
|
|
|
|
workflow_dispatch:
|
|
|
|
|
inputs:
|
|
|
|
|
root_sol:
|
2022-03-24 14:07:10 +00:00
|
|
|
|
description: "Release Title"
|
2021-11-22 08:23:56 +00:00
|
|
|
|
required: true
|
|
|
|
|
default: "SmsForwarder"
|
|
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
|
build:
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
steps:
|
2022-08-02 06:27:49 +00:00
|
|
|
|
# 检出代码
|
|
|
|
|
- uses: actions/checkout@v2
|
2022-08-02 06:22:03 +00:00
|
|
|
|
# 设置jdk环境为11
|
2021-11-22 08:23:56 +00:00
|
|
|
|
- name: set up JDK 11
|
|
|
|
|
uses: actions/setup-java@v1
|
|
|
|
|
with:
|
|
|
|
|
java-version: 11
|
|
|
|
|
# 获取打包秘钥
|
|
|
|
|
- name: Checkout Android Keystore
|
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
with:
|
|
|
|
|
repository: pppscn/keystore
|
|
|
|
|
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: ${{ github.ref }}
|
2021-11-22 10:15:57 +00:00
|
|
|
|
release_name: SmsForwarder ${{ github.ref }}
|
2021-11-22 08:23:56 +00:00
|
|
|
|
draft: false
|
|
|
|
|
prerelease: false
|
|
|
|
|
# 存档打包的文件
|
2022-08-01 07:46:59 +00:00
|
|
|
|
# - name: Archive production artifacts
|
|
|
|
|
# uses: actions/upload-artifact@v2
|
|
|
|
|
# with:
|
|
|
|
|
# name: build
|
|
|
|
|
# path: app/build/outputs #将打包之后的文件全部上传(里面会有混淆的map文件)
|
2021-11-22 08:23:56 +00:00
|
|
|
|
# 上传至release的资源
|
2022-01-30 06:23:01 +00:00
|
|
|
|
- name: Upload release binaries
|
|
|
|
|
uses: alexellis/upload-assets@0.2.2
|
2021-11-22 08:23:56 +00:00
|
|
|
|
env:
|
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|
with:
|
2022-01-30 06:23:01 +00:00
|
|
|
|
asset_paths: '["./app/build/outputs/apk/release/SmsForwarder_release_*"]'
|