Skip to content

Build SignPath Version #9

Build SignPath Version

Build SignPath Version #9

name: Build SignPath Version
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
cache: true
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: 构建项目
run: flutter build windows
- name: 构建 MSIX
run: dart run msix:create
- name: 安装 SignPath CLI
if: env.TOKEN != ''
shell: pwsh
run: |
Install-Module -Name SignPath -Force -AllowClobber -Scope CurrentUser
- name: SignPath 签名
if: env.TOKEN != ''
shell: pwsh
run: |
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