Skip to content

Commit

Permalink
chore: update project infrastructure and docs (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
ruibaby authored Aug 23, 2023
1 parent c014013 commit d61725d
Show file tree
Hide file tree
Showing 9 changed files with 69 additions and 56 deletions.
45 changes: 39 additions & 6 deletions .github/workflows/workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,20 @@ name: Build Plugin JAR File

on:
push:
branches: [ main ]
branches:
- main
paths:
- "**"
- "!**.md"
release:
types:
- created
pull_request:
branches:
- main
paths:
- "**"
- "!**.md"

jobs:
build:
Expand All @@ -17,18 +27,18 @@ jobs:
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
distribution: 'temurin'
cache: 'gradle'
distribution: "temurin"
cache: "gradle"
java-version: 17
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 18
- uses: pnpm/[email protected]
name: Install pnpm
id: pnpm-install
with:
version: 7
version: 8
run_install: false
- name: Get pnpm store directory
id: pnpm-cache
Expand Down Expand Up @@ -102,4 +112,27 @@ jobs:
release_id: releaseId,
name: artifactName,
data: await fs.readFile(artifactPathName)
});
});
app-store-release:
runs-on: ubuntu-latest
needs: build
if: github.event_name == 'release'
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Download plugin-migrate jar
uses: actions/download-artifact@v2
with:
name: plugin-migrate
path: build/libs
- name: Sync to Halo App Store
uses: halo-sigs/app-store-release-action@main
with:
github-token: ${{secrets.GITHUB_TOKEN}}
app-id: ${{secrets.APP_ID}}
release-id: ${{ github.event.release.id }}
assets-dir: "build/libs"
halo-username: ${{ secrets.HALO_USERNAME }}
halo-password: ${{ secrets.HALO_PASSWORD }}
26 changes: 16 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
# plugin-migrate

支持从 Halo 1.5/1.6 迁移数据
支持多种平台的数据迁移,目前已支持:

1. Halo 1.5 / 1.6
2. WordPress
3. RSS / Atom 订阅链接

## 使用方式

1. 下载,目前提供以下两个下载方式:
- GitHub Releases:访问 [Releases](https://github.com/halo-sigs/plugin-migrate/releases) 下载 Assets 中的 JAR 文件。
- Halo 应用市场:<https://halo.run/store/apps/app-TlUBt>
2. 安装,插件安装和更新方式可参考:<https://docs.halo.run/user-guide/plugins>
3. 启动插件之后,即可在 Console 的左侧菜单栏看到**迁移**的菜单。

> **Warning**
> 详细的迁移文档请查阅 <https://halo-plugin-migrate.pages.dev>
## 开发环境

Expand Down Expand Up @@ -46,12 +61,3 @@ halo:
fixedPluginPath:
- "/path/to/plugin-migrate"
```
## 使用方式
1. 在 [Releases](https://github.com/halo-sigs/plugin-migrate/releases) 下载最新的 JAR 文件。
2. 在 Halo 后台的插件管理上传 JAR 文件进行安装。
3. 启动插件之后,即可在 Console 的左侧菜单栏看到迁移的菜单。
> **Warning**
> 详细的迁移文档请查阅 <https://docs.halo.run/getting-started/migrate-from-1.x>
23 changes: 2 additions & 21 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id "com.github.node-gradle.node" version "3.3.0"
id "com.github.node-gradle.node" version "5.0.0"
id "io.freefair.lombok" version "8.0.0-rc2"
id "run.halo.plugin.devtools" version "0.0.5"
id 'java'
Expand All @@ -13,17 +13,6 @@ repositories {
maven { url 'https://s01.oss.sonatype.org/content/repositories/snapshots' }
}

jar {
enabled = true
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
manifest.attributes(
'Plugin-Version': "${project.version}",
)
into('lib') {
from configurations.runtimeClasspath
}
}

dependencies {
implementation platform('run.halo.tools.platform:plugin:2.5.0-SNAPSHOT')
compileOnly 'run.halo.app:api'
Expand All @@ -40,18 +29,10 @@ node {
nodeProjectDir = file("${project.projectDir}/console")
}

task buildFrontend(type: NpxTask) {
command = 'pnpm@7'
task buildFrontend(type: PnpmTask) {
args = ['build']
}

task pnpmInstall(type: NpxTask) {
command = "pnpm@7"
args = ["install"]
}

build {
// build frontend before build
tasks.getByName('compileJava').dependsOn('buildFrontend')
tasks.getByName("buildFrontend").dependsOn("pnpmInstall")
}
3 changes: 0 additions & 3 deletions console/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
{
"name": "@halo-dev/plugin-migrate",
"version": "1.1.0",
"private": true,
"scripts": {
"dev": "vite build --mode development --watch",
"build": "vite build",
Expand Down
2 changes: 1 addition & 1 deletion console/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/provider/halo.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
- 阿里云 OSS:<https://halo.run/store/apps/app-wCJCD>
- 在迁移过程中不会保留旧版本的用户数据,迁移完成之后,关于文章等数据的关联都将改为 Halo 2.0 的新用户。
- 为了防止直接升级 2.0 导致 1.x 的数据受到破坏,我们已经将工作目录由 `~/.halo` 变更为 `~/.halo2`
- 目前 Halo 2.0 仅提供 Docker 部署方式,没有提供可执行 JAR 包,但可以自编译,请参考 [构建](../developer-guide/core/build.md) 文档
- 目前 Halo 2.0 仅提供 Docker 部署方式,没有提供可执行 JAR 包,但可以自编译,请参考 [构建](https://docs.halo.run/developer-guide/core/build) 文档
- 可以考虑先在本地运行一个 Halo 2.0,模拟一下导入,检查导入后是否满足要求。

如果遇到了迁移过程中的问题,也可以向我们提交 Issue: <https://github.com/halo-dev/halo/issues/new/choose>,以上暂不支持的功能我们也会陆续完善。
Expand Down
4 changes: 0 additions & 4 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
pluginManagement {
repositories {
maven { url 'https://s01.oss.sonatype.org/content/repositories/snapshots' }
maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }
maven { url 'https://maven.aliyun.com/repository/spring-plugin' }
maven { url 'https://repo.spring.io/milestone' }
gradlePluginPortal()
}
}
Expand Down
18 changes: 9 additions & 9 deletions src/main/resources/console/main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/main/resources/console/style.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d61725d

Please sign in to comment.