Skip to content

Commit

Permalink
Merge pull request #582 from Hi-Windom/huge_merge
Browse files Browse the repository at this point in the history
Huge merge
  • Loading branch information
Soltus authored Nov 21, 2023
2 parents c7c6eca + a360491 commit b7c16eb
Show file tree
Hide file tree
Showing 760 changed files with 72,974 additions and 71,063 deletions.
17 changes: 11 additions & 6 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@

## Get the source code

* `git clone --recurse-submodules git@github.com:siyuan-note/siyuan.git` For example saved in `D:/siyuan/`
* switch to dev branch
* `git clone --depth=1 git@github.com:siyuan-note/siyuan.git`
* switch to dev branch `git checkout dev`

Note: `app/stage/protyle/**` is managed by git lfs, and you don't need to pay attention to it under normal circumstances, related to [#9253](https://github.com/siyuan-note/siyuan/issues/9253).

## User Interface

Expand All @@ -14,10 +16,10 @@ Install pnpm: `npm install -g pnpm`

Set the Electron mirror environment variable and install Electron:

* macOS/Linux: `ELECTRON_MIRROR=https://cnpmjs.org/mirrors/electron/ pnpm install electron@21.4.2 -D`
* macOS/Linux: `ELECTRON_MIRROR=https://cnpmjs.org/mirrors/electron/ pnpm install electron@25.9.4 -D`
* Windows:
* `SET ELECTRON_MIRROR=https://cnpmjs.org/mirrors/electron/`
* `pnpm install electron@21.4.2 -D`
* `pnpm install electron@25.9.4 -D`

NPM mirror:

Expand All @@ -28,14 +30,17 @@ NPM mirror:

On the desktop, go to the app folder to run:

* `pnpm install electron@21.4.2 -D`
* `pnpm install electron@25.9.4 -D`
* `pnpm run dev`
* `pnpm run start`

Note: In the development environment, the kernel process will not be automatically started, and you need to manually start the kernel process first.

## Kernel

1. Install the latest version of [golang](https://go.dev/)
2. Open CGO support, that is, configure the environment variable `CGO_ENABLED=1`

### Desktop

* `cd kernel`
Expand All @@ -52,7 +57,7 @@ Note: In the development environment, the kernel process will not be automatical
### Android

* `cd kernel`
* `gomobile bind --tags fts5 -ldflags '-s -w' -v -o kernel.aar -target='android/arm64' ./mobile/`
* `gomobile bind --tags fts5 -ldflags '-s -w' -v -o kernel.aar -target='android/arm64' -androidapi 24 ./mobile/`
* https://github.com/siyuan-note/siyuan-android

For the mobile-end, please refer to the corresponding project repository.
21 changes: 14 additions & 7 deletions .github/CONTRIBUTING_zh_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@

## 获取源码

* `git clone --recurse-submodules git@github.com:siyuan-note/siyuan.git` 例如保存在 `D:/siyuan/`
* 切换到 dev 分支
* `git clone --depth=1 git@github.com:siyuan-note/siyuan.git`
* 切换到 dev 分支 `git checkout dev`

备注:`app/stage/protyle/**` 使用 git lfs 管理,正常情况下无需关注,关联 [#9253](https://github.com/siyuan-note/siyuan/issues/9253)

## NPM 依赖

Expand All @@ -16,11 +18,11 @@

* macOS/Linux:
```
ELECTRON_MIRROR=https://cnpmjs.org/mirrors/electron/ pnpm install electron@21.4.2 -D
ELECTRON_MIRROR=https://cnpmjs.org/mirrors/electron/ pnpm install electron@25.9.4 -D
```
* Windows:
* `SET ELECTRON_MIRROR=https://cnpmjs.org/mirrors/electron/`
* `pnpm install electron@21.4.2 -D`
* `pnpm install electron@25.9.4 -D`

NPM 镜像:

Expand All @@ -30,14 +32,17 @@ NPM 镜像:

桌面端进入 app 文件夹运行:

* `pnpm install electron@21.4.2 -D`
* `pnpm install electron@25.9.4 -D`
* `pnpm run dev`
* `pnpm run start`

注意:在开发环境下不会自动拉起内核进程,需要先手动拉起内核进程。

## 内核

1. 安装最新版 [golang](https://go.dev/)
2. 打开 CGO 支持,即配置环境变量 `CGO_ENABLED=1`

### 桌面端

* `cd kernel`
Expand All @@ -47,12 +52,14 @@ NPM 镜像:

### iOS

* `gomobile bind --tags fts5 -ldflags '-s -w' -v -o ./ios/iosk.xcframework -target=ios ./kernel/mobile/`
* `cd kernel`
* `gomobile bind --tags fts5 -ldflags '-s -w' -v -o ./ios/iosk.xcframework -target=ios ./mobile/`
* https://github.com/siyuan-note/siyuan-ios

### Android

* `gomobile bind --tags fts5 -ldflags '-s -w' -v -o kernel.aar -target='android/arm64' ./kernel/mobile/`
* `cd kernel`
* `gomobile bind --tags fts5 -ldflags '-s -w' -v -o kernel.aar -target='android/arm64' -androidapi 24 ./mobile/`
* https://github.com/siyuan-note/siyuan-android

移动端请参考对应项目仓库。
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
blank_issues_enabled: true
blank_issues_enabled: true
35 changes: 17 additions & 18 deletions .github/workflows/ci.yml → .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,14 @@ jobs:

- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: ncipollo/release-action@v1
with:
release_name: ${{ steps.release_info.outputs.release_version }}
tag_name: ${{ github.ref }}
body: "${{ env.release_body_sillot }}\n---\n${{ env.release_body_siyuan }}"
draft: false
prerelease: true
token: ${{ secrets.GITHUB_TOKEN }}

build:
runs-on: ${{ matrix.config.os }}
Expand Down Expand Up @@ -146,23 +145,23 @@ jobs:

- name: Set up MingGW
uses: msys2/setup-msys2@v2
if: "contains( matrix.config.goos, 'windows')"
if: contains( matrix.config.goos, 'windows')
with:
install: p7zip mingw-w64-x86_64-lua

- name: Set up TDM-GCC
run: msys2 -c "bash go/src/github.com/Hi-Windom/Sillot/scripts/get-tdm-gcc.sh tdm https://github.com/jmeubank/tdm-gcc/releases/download/v10.3.0-tdm-1/tdm-gcc-10.3.0.exe" && echo "CC=${{ github.workspace }}/tdm/bin/gcc.exe" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
if: "contains( matrix.config.goarch, '386')"
if: contains( matrix.config.goarch, '386')
working-directory: ${{ github.workspace }}

- name: Set up Go
uses: actions/setup-go@v3
uses: actions/setup-go@v4
with:
go-version: 1.19
go-version: "1.21"

- name: Set up goversioninfo
run: go get github.com/josephspurrier/goversioninfo/cmd/goversioninfo && go install github.com/josephspurrier/goversioninfo/cmd/goversioninfo
if: "contains( matrix.config.goos, 'windows')"
if: contains( matrix.config.goos, 'windows')
working-directory: ${{ github.workspace }}/go/src/github.com/Hi-Windom/Sillot/kernel
env:
GO111MODULE: on
Expand Down Expand Up @@ -215,7 +214,7 @@ jobs:

- name: Generate Icon Resource and Properties/Version Info For Windows
run: ${{ github.workspace }}\go\${{ matrix.config.gobin }}\goversioninfo -platform-specific=true -icon="resource\icon.ico" -manifest="resource\goversioninfo.exe.manifest"
if: "contains( matrix.config.goos, 'windows')"
if: contains( matrix.config.goos, 'windows')
working-directory: ${{ github.workspace }}/go/src/github.com/Hi-Windom/Sillot/kernel

- name: Building Kernel
Expand Down Expand Up @@ -245,7 +244,7 @@ jobs:

- name: zip WinPortable
uses: thedoctor0/zip-release@0.7.1
if: "contains( matrix.config.goos, 'windows')"
if: contains( matrix.config.goos, 'windows')
with:
type: 'zip'
filename: Sillot-${{ needs.create_release.outputs.release_version }}-win_Portable_.zip
Expand All @@ -255,7 +254,7 @@ jobs:

- name: Upload WinPortable to release
uses: actions/upload-release-asset@v1
if: "contains( matrix.config.goos, 'windows')"
if: contains( matrix.config.goos, 'windows')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# 这里使用 bot
Expand All @@ -269,7 +268,7 @@ jobs:
# Manual setup is required when the built-in version does not work correctly in windows2022
- name: Setup JDK 11
uses: actions/setup-java@v3
if: "contains( matrix.config.goos, 'windows')"
if: contains( matrix.config.goos, 'windows')
continue-on-error: true
with:
java-version: '17'
Expand All @@ -284,32 +283,32 @@ jobs:
add-to-path: true
- name: Remove android Directory
uses: JesseTG/rm@v1.0.2
if: "contains( matrix.config.goos, 'windows')"
if: contains( matrix.config.goos, 'windows')
with:
path: ${{ github.workspace }}/go/src/github.com/Hi-Windom/SillotAndroid

- name: Checkout android repo
uses: actions/checkout@v3
if: "contains( matrix.config.goos, 'windows')"
if: contains( matrix.config.goos, 'windows')
with:
repository: Hi-Windom/Sillot-android
path: ${{ github.workspace }}/go/src/github.com/Hi-Windom/SillotAndroid

- name: Before android build
if: "contains( matrix.config.goos, 'windows')"
if: contains( matrix.config.goos, 'windows')
run: |
cd ${{ github.workspace }}/go/src/github.com/Hi-Windom/Sillot
.\scripts\sillot-android-build-action.bat
continue-on-error: false

- name: Build with Gradle
if: "contains( matrix.config.goos, 'windows')"
if: contains( matrix.config.goos, 'windows')
working-directory: ${{ github.workspace }}/go/src/github.com/Hi-Windom/SillotAndroid
run: ./gradlew assembleAction --quiet --stacktrace
continue-on-error: false

- uses: r0adkll/sign-android-release@v1
if: "contains( matrix.config.goos, 'windows')"
if: contains( matrix.config.goos, 'windows')
name: Sign APK
id: sign_app
with:
Expand All @@ -324,7 +323,7 @@ jobs:

- name: Upload APK to release
uses: actions/upload-release-asset@v1
if: "contains( matrix.config.goos, 'windows')"
if: contains( matrix.config.goos, 'windows')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
Expand Down
16 changes: 16 additions & 0 deletions .github/workflows/dockerimage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,22 @@ jobs:
contents: read

steps:
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
# this might remove tools that are actually needed,
# if set to "true" but frees about 6 GB
tool-cache: false

# all of these default to true, but feel free to set to
# "false" if necessary for your workflow
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: true
swap-storage: true

- name: Checkout repository and submodules
uses: actions/checkout@v3
with:
Expand Down
Loading

0 comments on commit b7c16eb

Please sign in to comment.