Build SignPath Version #6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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@v3.3.0 | |
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 --sign-msix false | |
- 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 "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@v3 | |
with: | |
name: BangumiToday(SignPath) | |
path: BangumiToday.msix |