Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

更新 CD 工作流 (#11140)

绛亽4ce87c7eb8ac
diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml
index 25584b4abf..5fc027cb66 100644
--- a/.github/workflows/cd.yml
+++ b/.github/workflows/cd.yml
@@ -17,10 +17,10 @@ jobs:
packageManager: ${{ steps.packageManager.outputs.value }}
steps:
- name: Checkout code
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
- name: Setup Python
- uses: actions/setup-python@v3
+ uses: actions/setup-python@v5
with:
python-version: "3.10"
- run: pip install PyGithub
@@ -72,11 +72,13 @@ jobs:
build:
runs-on: ${{ matrix.config.os }}
+ name: ${{ matrix.config.name }}
needs: create_release
strategy:
matrix:
config:
- os: ubuntu-20.04
+ name: ubuntu build linux.AppImage
kernel_path: "../app/kernel-linux/SiYuan-Kernel"
build_args: "-s -w -X github.com/siyuan-note/siyuan/kernel/util.Mode=prod"
electron_args: "dist-linux"
@@ -84,6 +86,7 @@ jobs:
goarch: "amd64"
suffix: "linux.AppImage"
- os: ubuntu-20.04
+ name: ubuntu build linux.tar.gz
kernel_path: "../app/kernel-linux/SiYuan-Kernel"
build_args: "-s -w -X github.com/siyuan-note/siyuan/kernel/util.Mode=prod"
electron_args: "dist-linux"
@@ -91,6 +94,7 @@ jobs:
goarch: "amd64"
suffix: "linux.tar.gz"
- os: macos-latest
+ name: macos build mac.dmg
kernel_path: "../app/kernel-darwin/SiYuan-Kernel"
build_args: "-s -w -X github.com/siyuan-note/siyuan/kernel/util.Mode=prod"
electron_args: "dist-darwin"
@@ -98,13 +102,15 @@ jobs:
goarch: "amd64"
suffix: "mac.dmg"
- os: macos-latest
+ name: macos build mac-arm64.dmg
kernel_path: "../app/kernel-darwin-arm64/SiYuan-Kernel"
build_args: "-s -w -X github.com/siyuan-note/siyuan/kernel/util.Mode=prod"
electron_args: "dist-darwin-arm64"
goos: "darwin"
goarch: "arm64"
suffix: "mac-arm64.dmg"
- - os: windows-2019
+ - os: windows-latest
+ name: windows build win.exe
kernel_path: "../app/kernel/SiYuan-Kernel.exe"
build_args: "-s -w -H=windowsgui -X github.com/siyuan-note/siyuan/kernel/util.Mode=prod"
electron_args: "dist"
@@ -115,7 +121,7 @@ jobs:
suffix: "win.exe"
steps:
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
with:
path: ${{ github.workspace }}/go/src/github.com/siyuan-note/siyuan
@@ -131,9 +137,10 @@ jobs:
working-directory: ${{ github.workspace }}
- name: Set up Go
- uses: actions/setup-go@v4
+ uses: actions/setup-go@v5
with:
- go-version: "1.22"
+ go-version-file: ${{ github.workspace }}/go/src/github.com/siyuan-note/siyuan/kernel/go.mod
+ - run: go version
- name: Set up goversioninfo
run: go get github.com/josephspurrier/goversioninfo/cmd/goversioninfo && go install github.com/josephspurrier/goversioninfo/cmd/goversioninfo
diff --git a/scripts/win-build.bat b/scripts/win-build.bat
index 8e2f50da4a..e153606d51 100644
--- a/scripts/win-build.bat
+++ b/scripts/win-build.bat
@@ -5,6 +5,9 @@ echo 'Building UI'
cd app
call pnpm install
call pnpm run build
+if errorlevel 1 (
+ exit /b %errorlevel%
+)
cd ..
echo 'Cleaning Builds'
@@ -26,13 +29,18 @@ set GOOS=windows
set GOARCH=amd64
@REM you can use `go mod tidy` to update kernel dependency before build
go build --tags fts5 -v -o "../app/kernel/SiYuan-Kernel.exe" -ldflags "-s -w -H=windowsgui" .
+if errorlevel 1 (
+ exit /b %errorlevel%
+)
cd ..
echo 'Building Electron'
cd app
call pnpm run dist
-
+if errorlevel 1 (
+ exit /b %errorlevel%
+)
cd ..
echo 'Building Appx'