Skip to content

Commit

Permalink
💚 调整CI
Browse files Browse the repository at this point in the history
  • Loading branch information
BTMuli committed Apr 17, 2024
1 parent 4981236 commit 5828b80
Show file tree
Hide file tree
Showing 3 changed files with 101 additions and 94 deletions.
100 changes: 100 additions & 0 deletions .github/workflows/release.yml
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/[email protected]
# with:
# tag: ${{ github.ref }}
# artifacts: |
# BangumiToday.zip
# BTMuli.cer
# BangumiToday.msix
# draft: true
# prerelease: true
93 changes: 0 additions & 93 deletions .github/workflows/release_dev.yml

This file was deleted.

2 changes: 1 addition & 1 deletion windows/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}"

# Sqlite3.dll
message("checking sqlite3.dll")
find_file(Sqlite sqlite3.dll PATHS "${INSTALL_BUNDLE_LIB_DIR}")
find_file(Sqlite sqlite3.dll PATHS "${PROJECT_BUILD_DIR}" NO_DEFAULT_PATH NO_CACHE)
if(NOT Sqlite)
message("sqlite3.dll not found, trying to find zip file in ${PROJECT_BUILD_DIR}")
find_file(SqliteZip sqlite3.zip PATHS "${PROJECT_BUILD_DIR}")
Expand Down

0 comments on commit 5828b80

Please sign in to comment.