Skip to content

Commit

Permalink
Merge pull request #627 from Hi-Windom/v0.29
Browse files Browse the repository at this point in the history
V0.29
  • Loading branch information
Soltus authored Apr 18, 2024
2 parents cea026d + 1e8b880 commit 1c4845c
Show file tree
Hide file tree
Showing 119 changed files with 3,658 additions and 4,075 deletions.
86 changes: 53 additions & 33 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name: Sillot CI/CD
on:
push:
tags:
- "v*"
- "v*-sillot"

jobs:
create_release:
Expand All @@ -20,6 +20,7 @@ jobs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
release_version: ${{ steps.release_info.outputs.release_version }}
version: ${{ steps.version.outputs.value }}
packageManager: ${{ steps.packageManager.outputs.value }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand Down Expand Up @@ -48,8 +49,14 @@ jobs:
with:
cmd: "jq .sypv app/package.json -r"

- id: thislatestR
uses: pozetroninc/github-action-get-latest-release@master
- name: Extract packageManager from package.json
uses: sergeysova/jq-action@v2
id: packageManager
with:
cmd: "jq .packageManager app/package.json -r"

- id: thisLatestRelease
uses: K-Sillot/github-action-get-latest-release@master
with:
# owner: Hi-Windom
# repo: Sillot
Expand All @@ -68,7 +75,7 @@ jobs:
run: |
echo "release_title=$(git show --format=%s --no-patch | head -1)" >> $GITHUB_OUTPUT
echo "release_version=v${{ steps.version.outputs.value }}_$(TZ=Asia/Shanghai date +'%Y%m%d')_syv${{ steps.syv.outputs.value }}" >> $GITHUB_OUTPUT
changelog1=$(python scripts/parse-changelog-HEAD.py -t ${{ github.ref }} -b ${{ steps.thislatestR.outputs.release }} ${{ matrix.string.repo_owner }}/${{ matrix.string.repo_name }})
changelog1=$(python scripts/parse-changelog-HEAD.py -t ${{ github.ref }} -b ${{ steps.thisLatestRelease.outputs.release }} ${{ matrix.string.repo_owner }}/${{ matrix.string.repo_name }})
changelog2=$(python scripts/parse-changelog-sillot.py -t ${{ github.ref }} ${{ matrix.string.repo_owner }}/${{ matrix.string.repo_name }})
changelog3=$(python scripts/parse-changelog-sillot.py -t ${{ github.ref }} ${{ matrix.string.repo_owner }}/${{ matrix.string.repo_name_android }})
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
Expand Down Expand Up @@ -152,11 +159,17 @@ jobs:
suffix: "win.exe"

steps:
- name: Enable long paths for windows # 如果路径超过了 260 个字符(对于 .pnpm 几乎不可避免),可能会遇到问题。GitHub Actions 的 windows-latest 已经支持长路径。
if: contains( matrix.config.goos, 'windows')
run: |
Get-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem' -Name 'LongPathsEnabled'
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" -Name "LongPathsEnabled" -Value 1

- name: Checkout repository and submodules
uses: actions/checkout@v4
with:
submodules: recursive
path: ${{ github.workspace }}/go/src/github.com/${{ matrix.string.repo_owner }}/${{ matrix.string.repo_name }}
path: ${{ github.workspace }}/${{ matrix.string.repo_owner }}/${{ matrix.string.repo_name }}

- name: Set up MingGW
uses: msys2/setup-msys2@v2
Expand All @@ -165,7 +178,7 @@ jobs:
install: p7zip mingw-w64-x86_64-lua

- name: Set up TDM-GCC
run: msys2 -c "bash go/src/github.com/${{ matrix.string.repo_owner }}/${{ matrix.string.repo_name }}/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
run: msys2 -c "bash ${{ matrix.string.repo_owner }}/${{ matrix.string.repo_name }}/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')
working-directory: ${{ github.workspace }}

Expand All @@ -177,7 +190,7 @@ jobs:
- 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')
working-directory: ${{ github.workspace }}/go/src/github.com/${{ matrix.string.repo_owner }}/${{ matrix.string.repo_name }}/kernel
working-directory: ${{ github.workspace }}/${{ matrix.string.repo_owner }}/${{ matrix.string.repo_name }}/kernel
env:
GO111MODULE: on
CGO_ENABLED: 1
Expand All @@ -191,53 +204,53 @@ jobs:
node-version: 20

- name: Install Node pnpm
run: npm install -g pnpm
working-directory: ${{ github.workspace }}/go/src/github.com/${{ matrix.string.repo_owner }}/${{ matrix.string.repo_name }}/app
run: npm install -g ${{ needs.create_release.outputs.packageManager }}
working-directory: ${{ github.workspace }}/${{ matrix.string.repo_owner }}/${{ matrix.string.repo_name }}/app

- name: Change NPMRC File
run: pnpm config set registry https://registry.npmjs.org/ --location project
working-directory: ${{ github.workspace }}/go/src/github.com/${{ matrix.string.repo_owner }}/${{ matrix.string.repo_name }}/app
working-directory: ${{ github.workspace }}/${{ matrix.string.repo_owner }}/${{ matrix.string.repo_name }}/app
- name: Install Node Dependencies
run: pnpm install --no-frozen-lockfile
working-directory: ${{ github.workspace }}/go/src/github.com/${{ matrix.string.repo_owner }}/${{ matrix.string.repo_name }}/app
working-directory: ${{ github.workspace }}/${{ matrix.string.repo_owner }}/${{ matrix.string.repo_name }}/app

- name: Building UI
run: pnpm run build
working-directory: ${{ github.workspace }}/go/src/github.com/${{ matrix.string.repo_owner }}/${{ matrix.string.repo_name }}/app
working-directory: ${{ github.workspace }}/${{ matrix.string.repo_owner }}/${{ matrix.string.repo_name }}/app

- name: Remove Build Directory
uses: JesseTG/rm@v1.0.2
uses: K-Sillot/rm@master
with:
path: ${{ github.workspace }}/go/src/github.com/${{ matrix.string.repo_owner }}/${{ matrix.string.repo_name }}/app/build
path: ${{ github.workspace }}/${{ matrix.string.repo_owner }}/${{ matrix.string.repo_name }}/app/build

- name: Remove Kernel Directory for Linux
uses: JesseTG/rm@v1.0.2
uses: K-Sillot/rm@master
with:
path: ${{ github.workspace }}/go/src/github.com/${{ matrix.string.repo_owner }}/${{ matrix.string.repo_name }}/app/kernel-linux
path: ${{ github.workspace }}/${{ matrix.string.repo_owner }}/${{ matrix.string.repo_name }}/app/kernel-linux

- name: Remove Kernel Directory for Windows
uses: JesseTG/rm@v1.0.2
uses: K-Sillot/rm@master
with:
path: ${{ github.workspace }}/go/src/github.com/${{ matrix.string.repo_owner }}/${{ matrix.string.repo_name }}/app/kernel
path: ${{ github.workspace }}/${{ matrix.string.repo_owner }}/${{ matrix.string.repo_name }}/app/kernel

# - name: Remove Kernel Directory for macOS
# uses: JesseTG/rm@v1.0.2
# uses: K-Sillot/rm@master
# with:
# path: ${{ github.workspace }}/go/src/github.com/${{ matrix.string.repo_owner }}/${{ matrix.string.repo_name }}/app/kernel-darwin
# path: ${{ github.workspace }}/${{ matrix.string.repo_owner }}/${{ matrix.string.repo_name }}/app/kernel-darwin

# - name: Remove Kernel Directory for macOS ARM64
# uses: JesseTG/rm@v1.0.2
# uses: K-Sillot/rm@master
# with:
# path: ${{ github.workspace }}/go/src/github.com/${{ matrix.string.repo_owner }}/${{ matrix.string.repo_name }}/app/kernel-darwin-arm64
# path: ${{ github.workspace }}/${{ matrix.string.repo_owner }}/${{ matrix.string.repo_name }}/app/kernel-darwin-arm64

- 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')
working-directory: ${{ github.workspace }}/go/src/github.com/${{ matrix.string.repo_owner }}/${{ matrix.string.repo_name }}/kernel
working-directory: ${{ github.workspace }}/${{ matrix.string.repo_owner }}/${{ matrix.string.repo_name }}/kernel

- name: Building Kernel
run: go build --tags fts5 -o "${{ matrix.config.kernel_path }}" -v -ldflags "${{ matrix.config.build_args }}"
working-directory: ${{ github.workspace }}/go/src/github.com/${{ matrix.string.repo_owner }}/${{ matrix.string.repo_name }}/kernel
working-directory: ${{ github.workspace }}/${{ matrix.string.repo_owner }}/${{ matrix.string.repo_name }}/kernel
env:
GO111MODULE: on
CGO_ENABLED: 1
Expand All @@ -247,7 +260,7 @@ jobs:

- name: Building Electron
run: pnpm run ${{ matrix.config.electron_args }}
working-directory: ${{ github.workspace }}/go/src/github.com/${{ matrix.string.repo_owner }}/${{ matrix.string.repo_name }}/app
working-directory: ${{ github.workspace }}/${{ matrix.string.repo_owner }}/${{ matrix.string.repo_name }}/app

- name: Upload Release Asset for Windows & Linux
uses: shogo82148/actions-upload-release-asset@v1
Expand All @@ -256,15 +269,15 @@ jobs:
with:
upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_name: ${{ matrix.string.repo_name }}-${{ needs.create_release.outputs.release_version }}-${{ matrix.config.suffix }}
asset_path: ${{ github.workspace }}/go/src/github.com/${{ matrix.string.repo_owner }}/${{ matrix.string.repo_name }}/app/build/${{ matrix.string.repo_name }}-${{ needs.create_release.outputs.version }}-${{ matrix.config.suffix }}
asset_path: ${{ github.workspace }}/${{ matrix.string.repo_owner }}/${{ matrix.string.repo_name }}/app/build/${{ matrix.string.repo_name }}-${{ needs.create_release.outputs.version }}-${{ matrix.config.suffix }}

- name: zip WinPortable
uses: thedoctor0/[email protected]
if: contains( matrix.config.goos, 'windows')
with:
type: 'zip'
filename: ${{ matrix.string.repo_name }}-${{ needs.create_release.outputs.release_version }}-win_Portable_.zip
path: ${{ github.workspace }}/go/src/github.com/${{ matrix.string.repo_owner }}/${{ matrix.string.repo_name }}/app/build/win-unpacked/
path: ${{ github.workspace }}/${{ matrix.string.repo_owner }}/${{ matrix.string.repo_name }}/app/build/win-unpacked/
exclusions: '*.git*'
recursive_exclusions: 'LICENSES.chromium.html'

Expand Down Expand Up @@ -298,28 +311,28 @@ jobs:
ndk-version: r25b
add-to-path: true
- name: Remove android Directory
uses: JesseTG/rm@v1.0.2
uses: K-Sillot/rm@master
if: contains( matrix.config.goos, 'windows')
with:
path: ${{ github.workspace }}/go/src/github.com/${{ matrix.string.repo_owner }}/${{ matrix.string.repo_name_android }}
path: ${{ github.workspace }}/${{ matrix.string.repo_owner }}/${{ matrix.string.repo_name_android }}

- name: Checkout android repo
uses: actions/checkout@v4
if: contains( matrix.config.goos, 'windows')
with:
repository: ${{ matrix.string.repo_owner }}/${{ matrix.string.repo_name_android }}
path: ${{ github.workspace }}/go/src/github.com/${{ matrix.string.repo_owner }}/${{ matrix.string.repo_name_android }}
path: ${{ github.workspace }}/${{ matrix.string.repo_owner }}/${{ matrix.string.repo_name_android }}

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

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

Expand All @@ -328,7 +341,7 @@ jobs:
name: Sign APK
id: sign_app
with:
releaseDirectory: ${{ github.workspace }}/go/src/github.com/${{ matrix.string.repo_owner }}/${{ matrix.string.repo_name_android }}/app/build/outputs/apk/action
releaseDirectory: ${{ github.workspace }}/${{ matrix.string.repo_owner }}/${{ matrix.string.repo_name_android }}/app/build/outputs/apk/action
signingKeyBase64: ${{ secrets.APK_SIGN_KEY_JKS_BASE64 }}
alias: ${{ secrets.APK_SIGN_KEY_ALIAS }}
keyStorePassword: ${{ secrets.APK_SIGN_KEY_JKS_PW }}
Expand All @@ -346,3 +359,10 @@ jobs:
upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_name: ${{ matrix.string.repo_name }}-${{ needs.create_release.outputs.release_version }}-beta_github.apk
asset_path: ${{steps.sign_app.outputs.signedReleaseFile}}

- name: Upload logs if failure
if: failure()
uses: actions/upload-artifact@v4
with:
name: logs
path: ./**/*.log
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ electron/dist

# IDE
.idea/
.vscode/

# Log
logs
Expand Down
8 changes: 6 additions & 2 deletions app/appearance/langs/en_US.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@
"goToEditTabPrev": "Go to previous edited tab",
"createdTime": "Created time",
"updatedTime": "Updated time",
"lineNumber": "Line number",
"removeBookmark": "Remove bookmark from ${x}?",
"defaultMargin": "Default",
"noneMargin": "None",
Expand Down Expand Up @@ -1222,7 +1223,9 @@
"officialWebsite": "Visit official website",
"openSource": "Visit project on GitHub",
"resetWindow": "Reset window and exit",
"quit": "Quit application"
"quit": "Quit application",
"openWSlog": "Locate WS Log Dir",
"openAPPlog": "Open App log"
},
"_attrView": {
"table": "Table",
Expand Down Expand Up @@ -1471,6 +1474,7 @@
"238": "Marketplace package [%s] update failed, please try again later",
"239": "Related operations are being processed, please try again later",
"240": "Drag heading under container blocks in the doc is not supported",
"241": "Drag to its subheading is not supported"
"241": "Drag to its subheading is not supported",
"242": "The binding block already exists in the current database"
}
}
8 changes: 6 additions & 2 deletions app/appearance/langs/es_ES.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@
"goToEditTabPrev": "Ir a la pestaña editada anteriormente",
"createdTime": "Hora de creación",
"updatedTime": "Hora actualizada",
"lineNumber": "Número de línea",
"removeBookmark": "¿Eliminar marcador de ${x}?",
"lockEdit": "Hacer que el documento sea de sólo lectura",
"unlockEdit": "Hacer que el documento sea escribible",
Expand Down Expand Up @@ -1222,7 +1223,9 @@
"officialWebsite": "Visita el sitio web oficial",
"openSource": "Visita el proyecto en GitHub",
"resetWindow": "Restablecer ventana y salir del programa",
"quit": "Salir de la aplicación"
"quit": "Salir de la aplicación",
"openWSlog": "Locate WS Log Dir",
"openAPPlog": "Open App log"
},
"_attrView": {
"tabla": "Tabla",
Expand Down Expand Up @@ -1471,6 +1474,7 @@
"238": "Error en la actualización del paquete Marketplace [%s], inténtalo de nuevo más tarde",
"239": "Las operaciones relacionadas se están procesando, inténtalo de nuevo más tarde",
"240": "No se admite arrastrar encabezado debajo de los bloques contenedores en el documento",
"241": "No se admite arrastrar a su subtítulo"
"241": "No se admite arrastrar a su subtítulo",
"242": "El bloque de enlace ya existe en la base de datos actual"
}
}
8 changes: 6 additions & 2 deletions app/appearance/langs/fr_FR.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@
"goToEditTabPrev": "Aller à l'onglet modifié précédent",
"createdTime": "Heure de création",
"updatedTime": "Heure mise à jour",
"lineNumber": "Numéro de ligne",
"removeBookmark": "Supprimer le signet de ${x} ?",
"lockEdit": "Rendre le document en lecture seule",
"unlockEdit": "Rendre le document accessible en écriture",
Expand Down Expand Up @@ -1222,7 +1223,9 @@
"officialWebsite": "Visiter le site officiel",
"openSource": "Visitez le projet sur GitHub",
"resetWindow": "Réinitialiser la fenêtre et quitter le programme",
"quit": "Quitter le programme"
"quit": "Quitter le programme",
"openWSlog": "Locate WS Log Dir",
"openAPPlog": "Open App log"
},
"_attrView": {
"table": "Tableau",
Expand Down Expand Up @@ -1471,6 +1474,7 @@
"238": "La mise à jour du package Marketplace [%s] a échoué, veuillez réessayer plus tard",
"239": "Les opérations associées sont en cours de traitement, veuillez réessayer plus tard",
"240": "Le déplacement du titre sous les blocs conteneurs dans la doc n'est pas pris en charge",
"241": "Le glisser vers son sous-titre n'est pas pris en charge"
"241": "Le glisser vers son sous-titre n'est pas pris en charge",
"242": "Le bloc de liaison existe déjà dans la base de données actuelle"
}
}
8 changes: 6 additions & 2 deletions app/appearance/langs/zh_CHT.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@
"goToEditTabPrev": "跳到上一個編輯頁籤",
"createdTime": "建立時間",
"updatedTime": "更新時間",
"lineNumber": "行號",
"removeBookmark": "移除 ${x} 中的書籤?",
"lockEdit": "鎖定編輯",
"unlockEdit": "解除鎖定",
Expand Down Expand Up @@ -1222,7 +1223,9 @@
"officialWebsite": "訪問官方網站",
"openSource": "訪問 GitHub 項目",
"resetWindow": "重置窗口並退出程序",
"quit": "退出程序"
"quit": "退出程序",
"openWSlog": "定位工作空间日志目录",
"openAPPlog": "打开应用日志"
},
"_attrView": {
"table": "表格",
Expand Down Expand Up @@ -1471,6 +1474,7 @@
"238": "市集包 [%s] 更新失敗,請稍後再試",
"239": "相關操作正在處理中,請稍後再試",
"240": "不支援拖曳文件中容器區塊下的標題",
"241": "不支持拖曳為自己的子標題"
"241": "不支持拖曳為自己的子標題",
"242": "目前資料庫中已經存在該綁定區塊"
}
}
8 changes: 6 additions & 2 deletions app/appearance/langs/zh_CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@
"goToEditTabPrev": "跳转到上一个编辑页签",
"createdTime": "创建时间",
"updatedTime": "更新时间",
"lineNumber": "行号",
"removeBookmark": "移除 ${x} 中的书签?",
"lockEdit": "锁定编辑",
"unlockEdit": "解除锁定",
Expand Down Expand Up @@ -1224,7 +1225,9 @@
"officialWebsite": "访问官网",
"openSource": "访问 GitHub 项目",
"resetWindow": "重置窗口并退出程序",
"quit": "退出程序"
"quit": "退出程序",
"openWSlog": "定位工作空间日志目录",
"openAPPlog": "打开应用日志"
},
"_attrView": {
"table": "表格",
Expand Down Expand Up @@ -1473,6 +1476,7 @@
"238": "集市包 [%s] 更新失败,请稍后再试",
"239": "相关操作正在处理中,请稍后再试",
"240": "不支持拖拽文档中容器块下的标题",
"241": "不支持拖拽为自己的子标题"
"241": "不支持拖拽为自己的子标题",
"242": "当前数据库中已经存在该绑定块"
}
}
2 changes: 1 addition & 1 deletion app/appx/AppxManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<Identity Name="89C2A984.SiYuan"
ProcessorArchitecture="x64"
Publisher="CN=087C656E-C1D9-42D8-8807-CED45A74FC0F"
Version="3.0.8.0"/>
Version="3.0.10.0"/>
<Properties>
<DisplayName>SiYuan</DisplayName>
<PublisherDisplayName>云南链滴科技有限公司</PublisherDisplayName>
Expand Down
Loading

0 comments on commit 1c4845c

Please sign in to comment.