Skip to content

Commit

Permalink
改进 Sillot CI/CD 工作流 #655
Browse files Browse the repository at this point in the history
  • Loading branch information
Soltus committed Apr 25, 2024
1 parent 844f8e4 commit fa47ae5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
16 changes: 10 additions & 6 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,23 +128,26 @@ jobs:
- os: ubuntu-20.04
name: ubuntu build linux.AppImage
kernel_path: "../app/kernel-linux/SiYuan-Sillot-Kernel"
build_args: "-s -w -X github.com/$repo_owner/$repo_name/kernel/util.Mode=prod"
build_args_prefix: "-s -w -X"
build_args_suffix: "Mode=prod"
electron_args: "dist-linux"
goos: "linux"
goarch: "amd64"
suffix: "linux.AppImage"
- os: ubuntu-20.04
name: ubuntu build linux.tar.gz
kernel_path: "../app/kernel-linux/SiYuan-Sillot-Kernel"
build_args: "-s -w -X github.com/$repo_owner/$repo_name/kernel/util.Mode=prod"
build_args_prefix: "-s -w -X"
build_args_suffix: "Mode=prod"
electron_args: "dist-linux"
goos: "linux"
goarch: "amd64"
suffix: "linux.tar.gz"
- os: windows-latest
name: windows build win.exe
kernel_path: "../app/kernel/SiYuan-Sillot-Kernel.exe"
build_args: "-s -w -H=windowsgui -X github.com/$repo_owner/$repo_name/kernel/util.Mode=prod"
build_args_prefix: "-s -w -H=windowsgui -X"
build_args_suffix: "Mode=prod"
electron_args: "dist"
goos: "windows"
gobin: "bin"
Expand All @@ -154,7 +157,8 @@ jobs:
- os: windows-latest
name: windows build android.apk
kernel_path: "../app/kernel/SiYuan-Sillot-Kernel.exe"
build_args: "-s -w -H=windowsgui -X github.com/$repo_owner/$repo_name/kernel/util.Mode=prod"
build_args_prefix: "-s -w -H=windowsgui -X"
build_args_suffix: "Mode=prod"
electron_args: "dist"
goos: "windows"
gobin: "bin"
Expand All @@ -165,7 +169,7 @@ jobs:
steps:
- name: test
run: |
echo "${{ matrix.config.build_args }}"
echo "${{ matrix.config.build_args_prefix }} github.com/${{ env.repo_owner }}/${{ env.repo_name }}/kernel/util.${{ matrix.config.build_args_suffix }}"
- name: Enable long paths for windows # 如果路径超过了 260 个字符(对于 .pnpm 几乎不可避免),可能会遇到问题。GitHub Actions 的 windows-latest 已经支持长路径。
if: contains( matrix.config.goos, 'windows')
run: |
Expand Down Expand Up @@ -251,7 +255,7 @@ jobs:

- name: Building Kernel
if: ${{ !contains( matrix.config.suffix, 'apk') }}
run: go build --tags fts5 -o "${{ matrix.config.kernel_path }}" -v -ldflags "${{ matrix.config.build_args }}"
run: go build --tags fts5 -o "${{ matrix.config.kernel_path }}" -v -ldflags "${{ matrix.config.build_args_prefix }} github.com/${{ env.repo_owner }}/${{ env.repo_name }}/kernel/util.${{ matrix.config.build_args_suffix }}"
working-directory: ${{ github.workspace }}/${{ env.repo_owner }}/${{ env.repo_name }}/kernel
env:
GO111MODULE: on
Expand Down
2 changes: 1 addition & 1 deletion app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sillot",
"version": "0.31.1800",
"version": "0.31.1810",
"syv": "3.0.12",
"sypv": "[]",
"description": "Build Your Eternal Digital Garden",
Expand Down

0 comments on commit fa47ae5

Please sign in to comment.