Skip to content

Commit

Permalink
🚧 测试Release CI
Browse files Browse the repository at this point in the history
  • Loading branch information
BTMuli committed Apr 17, 2024
1 parent 12e1c11 commit 9e7e3d0
Showing 1 changed file with 89 additions and 0 deletions.
89 changes: 89 additions & 0 deletions .github/workflows/release_dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: Build Release(Dev)

on: workflow_dispatch

jobs:
build:
name: Build Windows
runs-on: windows-latest
env:
TOKEN: ${{ secrets.SIGN_PATH_TOKEN }}
BANGUMI_APP_ID: ${{ secrets.BANGUMI_APP_ID }}
BANGUMI_APP_SECRET: ${{ secrets.BANGUMI_APP_SECRET }}
steps:

- name: 签出仓库
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: master

- name: 初始化 Flutter 环境
uses: subosito/flutter-action@v2
with:
channel: stable
architecture: x64

- name: 检查环境
run: flutter doctor

- name: 拉取依赖
run: flutter pub get

- name: 写入 .env
shell: pwsh
run: |
New-Item -Path . -Name .env -ItemType File -Force
Add-Content -Path .env -Value "BANGUMI_APP_ID=${env:BANGUMI_APP_ID}"
Add-Content -Path env -Value "BANGUMI_APP_SECRET=${env:BANGUMI_APP_SECRET}"
- name: 打包msix
run: dart run msix:create --sign-msix false

- name: SignPath 签名
if: env.TOKEN != ''
shell: pwsh
run: |
Install-Module -Name SignPath -Force -AllowClobber -Scope CurrentUser
Submit-SigningRequest `
-InputArtifactPath "build/windows/x64/runner/Release/BangumiToday.msix" `
-ApiToken "${env:TOKEN}" `
-OrganizationId "df493769-e8b5-461d-84a8-e9cc2071d9b2" `
-ProjectSlug "BangumiToday" `
-SigningPolicySlug "Dev" `
-OutputArtifactPath "BangumiToday.msix" `
-WaitForCompletion
- name: 上传 MSIX
if: env.TOKEN != ''
uses: actions/upload-artifact@v4
with:
name: BangumiToday(SignPath).msix
path: BangumiToday.msix

- name: 上传证书
uses: actions/upload-artifact@v4
with:
name: BTMuli.cer
path: $HOME/BTMuli.cer

- name: 删除 msix 并打包
shell: pwsh
run: |
Remove-Item -Path build/windows/x64/runner/Release/BangumiToday.msix
Compress-Archive -Path build/windows/x64/runner/Release -DestinationPath BangumiToday.zip
- name: 上传打包文件
uses: actions/upload-artifact@v4
with:
name: BangumiToday.zip
path: BangumiToday.zip

- name: 发行Release
uses: ncipollo/[email protected]
with:
files: |
BangumiToday.zip
BTMuli.cer
BangumiToday(SignPath).msix
draft: true

0 comments on commit 9e7e3d0

Please sign in to comment.