From c43ed813e4b43733061ec06ac8387dcdc40eb6ca Mon Sep 17 00:00:00 2001 From: pppscn <35696959@qq.com> Date: Thu, 24 Mar 2022 22:07:10 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=EF=BC=9A=E5=AE=9A=E6=97=B6?= =?UTF-8?q?=E5=8F=91=E5=B8=83=20=E6=AF=8F=E5=A4=9C=E6=9E=84=E5=BB=BA=20?= =?UTF-8?q?=E7=89=88=E6=9C=AC=EF=BC=88=E5=8C=97=E4=BA=AC=E6=97=B6=E9=97=B4?= =?UTF-8?q?=EF=BC=9A23:30=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/Nightly_Build.yml | 60 +++++++++++++++++++ .../{SmsForwarder.yml => Release.yml} | 4 +- 2 files changed, 62 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/Nightly_Build.yml rename .github/workflows/{SmsForwarder.yml => Release.yml} (94%) diff --git a/.github/workflows/Nightly_Build.yml b/.github/workflows/Nightly_Build.yml new file mode 100644 index 00000000..84b86f23 --- /dev/null +++ b/.github/workflows/Nightly_Build.yml @@ -0,0 +1,60 @@ +name: Nightly Build + +# 触发器 +on: + schedule: + - cron: '30 15 * * *' #每天在国际标准时间14点(北京时间+8,即 23:30) + workflow_dispatch: + inputs: + root_sol: + description: "Nightly Build Title" + required: true + default: "SmsForwarder" + +jobs: + build: + + runs-on: ubuntu-latest + # if: github.event.repository.owner.id == github.event.sender.id + + # 设置jdk环境为11 + steps: + - uses: actions/checkout@v2 + - name: set up JDK 11 + uses: actions/setup-java@v1 + with: + java-version: 11 + # ref: dev + # 获取打包秘钥 + - 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 }} + #GitHub 会自动创建 GITHUB_TOKEN 密码以在工作流程中使用。 + #您可以使用 GITHUB_TOKEN 在工作流程运行中进行身份验证。 + #当您启用 GitHub Actions 时,GitHub 在您的仓库中安装 GitHub 应用程序。 + #GITHUB_TOKEN 密码是一种 GitHub 应用程序 安装访问令牌。 + #您可以使用安装访问令牌代表仓库中安装的 GitHub 应用程序 进行身份验证。 + #令牌的权限仅限于包含您的工作流程的仓库。 更多信息请参阅“GITHUB_TOKEN 的权限”。 + #在每个作业开始之前, GitHub 将为作业提取安装访问令牌。 令牌在作业完成后过期。 + with: + tag_name: ${{ github.ref }} + release_name: SmsForwarder ${{ github.ref }} + draft: false + prerelease: false + # 存档打包的文件 + - name: Archive production artifacts + uses: actions/upload-artifact@v3 + with: + path: app/build/outputs/apk/release/*.apk diff --git a/.github/workflows/SmsForwarder.yml b/.github/workflows/Release.yml similarity index 94% rename from .github/workflows/SmsForwarder.yml rename to .github/workflows/Release.yml index 4e057bf0..a5ffa543 100644 --- a/.github/workflows/SmsForwarder.yml +++ b/.github/workflows/Release.yml @@ -1,4 +1,4 @@ -name: Build SmsForwarder +name: Release # 触发器 on: @@ -11,7 +11,7 @@ on: workflow_dispatch: inputs: root_sol: - description: "Release title" + description: "Release Title" required: true default: "SmsForwarder"