-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
101 additions
and
94 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
name: Build Release(Dev) | ||
|
||
on: | ||
workflow_dispatch: | ||
# push: | ||
# tags: | ||
# - 'v*.*.*' | ||
|
||
jobs: | ||
build: | ||
name: Build Windows | ||
runs-on: windows-latest | ||
permissions: | ||
contents: write | ||
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: 打包 | ||
run: flutter build windows | ||
|
||
- name: 压缩 | ||
shell: pwsh | ||
run: | | ||
Compress-Archive -Path build/windows/x64/runner/Release -DestinationPath BangumiToday.zip | ||
- name: 上传打包文件 | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: BangumiToday | ||
path: BangumiToday.zip | ||
|
||
# - 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) | ||
# path: BangumiToday.msix | ||
# | ||
# - name: 上传证书 | ||
# uses: actions/upload-artifact@v4 | ||
# with: | ||
# name: BTMuli.cer | ||
# path: BTMuli.cer | ||
# | ||
# - name: 发行Release | ||
# uses: ncipollo/release-action@v1.5.0 | ||
# with: | ||
# tag: ${{ github.ref }} | ||
# artifacts: | | ||
# BangumiToday.zip | ||
# BTMuli.cer | ||
# BangumiToday.msix | ||
# draft: true | ||
# prerelease: true |
This file was deleted.
Oops, something went wrong.
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