chore: update readme and archive config
This commit is contained in:
parent
c2d7168c26
commit
3db803ed38
3 changed files with 19 additions and 71 deletions
|
@ -40,7 +40,7 @@ archives:
|
|||
- format: tar.gz
|
||||
# this name template makes the OS and Arch compatible with the results of uname.
|
||||
name_template: >-
|
||||
{{ .ProjectName }}_
|
||||
cloudreve_
|
||||
{{- .Os }}_
|
||||
{{- if eq .Arch "amd64" }}x86_64
|
||||
{{- else if eq .Arch "386" }}i386
|
||||
|
|
44
README.md
44
README.md
|
@ -50,7 +50,7 @@
|
|||
* :card_file_box: Drag & Drop to manage your files.
|
||||
* :family_woman_girl_boy: Multi-users with multi-groups.
|
||||
* :link: Create share links for files and folders with expiration date.
|
||||
* :eye_speech_bubble: Preview videos, images, audios, texts, Office documents, ePub files online.
|
||||
* :eye_speech_bubble: Preview videos, images, audios, ePub files online; edit texts, Office documents online.
|
||||
* :art: Customize theme colors, dark mode, PWA application, SPA, i18n.
|
||||
* :rocket: All-In-One packing, with all features out-of-the-box.
|
||||
* 🌈 ... ...
|
||||
|
@ -74,7 +74,13 @@ The above is a minimum deploy example, you can refer to [Getting started](https:
|
|||
|
||||
## :gear: Build
|
||||
|
||||
You need to have `Go >= 1.18`, `node.js`, `yarn`, `zip` and other necessary dependencies before you can build it yourself.
|
||||
You need to have `Go >= 1.18`, `node.js`, `yarn`, `zip`, [goreleaser](https://goreleaser.com/intro/) and other necessary dependencies before you can build it yourself.
|
||||
|
||||
#### Install goreleaser
|
||||
|
||||
```shell
|
||||
go install github.com/goreleaser/goreleaser@latest
|
||||
```
|
||||
|
||||
#### Clone the code
|
||||
|
||||
|
@ -82,42 +88,10 @@ You need to have `Go >= 1.18`, `node.js`, `yarn`, `zip` and other necessary depe
|
|||
git clone --recurse-submodules https://github.com/cloudreve/Cloudreve.git
|
||||
```
|
||||
|
||||
#### Build static resources
|
||||
|
||||
```shell
|
||||
# Enter frontend sub-module
|
||||
cd assets
|
||||
# Install dependencies
|
||||
yarn install
|
||||
# Start building
|
||||
yarn run build
|
||||
# Delete unused map files
|
||||
cd build
|
||||
find . -name "*.map" -type f -delete
|
||||
# Return to main folder to pack static files
|
||||
cd ../../
|
||||
zip -r - assets/build >assets.zip
|
||||
```
|
||||
|
||||
#### Compile
|
||||
|
||||
```shell
|
||||
# Obtain version number, commit SHA
|
||||
export COMMIT_SHA=$(git rev-parse --short HEAD)
|
||||
export VERSION=$(git describe --tags)
|
||||
|
||||
# Compile
|
||||
go build -a -o cloudreve -ldflags "-s -w -X 'github.com/cloudreve/Cloudreve/v3/pkg/conf.BackendVersion=$VERSION' -X 'github.com/cloudreve/Cloudreve/v3/pkg/conf.LastCommit=$COMMIT_SHA'"
|
||||
```
|
||||
|
||||
You can also start a quick build using `build.sh` in the project root directory:
|
||||
|
||||
```shell
|
||||
./build.sh [-a] [-c] [-b] [-r]
|
||||
a - Build assets
|
||||
c - Build binary backend
|
||||
b - Build both assets and backend
|
||||
r - Cross-compilation for final release
|
||||
goreleaser build --clean --single-target --snapshot
|
||||
```
|
||||
|
||||
## :alembic: Stacks
|
||||
|
|
|
@ -50,7 +50,7 @@
|
|||
* :card_file_box: 文件拖拽管理
|
||||
* :family_woman_girl_boy: 多用户、用户组、多存储策略
|
||||
* :link: 创建文件、目录的分享链接,可设定自动过期
|
||||
* :eye_speech_bubble: 视频、图像、音频、文本、Office 文档、 ePub 在线预览
|
||||
* :eye_speech_bubble: 视频、图像、音频、 ePub 在线预览,文本、Office 文档在线编辑
|
||||
* :art: 自定义配色、黑暗模式、PWA 应用、全站单页应用、国际化支持
|
||||
* :rocket: All-In-One 打包,开箱即用
|
||||
* 🌈 ... ...
|
||||
|
@ -74,7 +74,13 @@ chmod +x ./cloudreve
|
|||
|
||||
## :gear: 构建
|
||||
|
||||
自行构建前需要拥有 `Go >= 1.18`、`node.js`、`yarn`、`zip` 等必要依赖。
|
||||
自行构建前需要拥有 `Go >= 1.18`、`node.js`、`yarn`、`zip`, [goreleaser](https://goreleaser.com/intro/) 等必要依赖。
|
||||
|
||||
#### 安装 goreleaser
|
||||
|
||||
```shell
|
||||
go install github.com/goreleaser/goreleaser@latest
|
||||
```
|
||||
|
||||
#### 克隆代码
|
||||
|
||||
|
@ -82,42 +88,10 @@ chmod +x ./cloudreve
|
|||
git clone --recurse-submodules https://github.com/cloudreve/Cloudreve.git
|
||||
```
|
||||
|
||||
#### 构建静态资源
|
||||
|
||||
```shell
|
||||
# 进入前端子模块
|
||||
cd assets
|
||||
# 安装依赖
|
||||
yarn install
|
||||
# 开始构建
|
||||
yarn run build
|
||||
# 构建完成后删除映射文件
|
||||
cd build
|
||||
find . -name "*.map" -type f -delete
|
||||
# 返回项目主目录打包静态资源
|
||||
cd ../../
|
||||
zip -r - assets/build >assets.zip
|
||||
```
|
||||
|
||||
#### 编译项目
|
||||
|
||||
```shell
|
||||
# 获得当前版本号、Commit
|
||||
export COMMIT_SHA=$(git rev-parse --short HEAD)
|
||||
export VERSION=$(git describe --tags)
|
||||
|
||||
# 开始编译
|
||||
go build -a -o cloudreve -ldflags "-s -w -X 'github.com/cloudreve/Cloudreve/v3/pkg/conf.BackendVersion=$VERSION' -X 'github.com/cloudreve/Cloudreve/v3/pkg/conf.LastCommit=$COMMIT_SHA'"
|
||||
```
|
||||
|
||||
你也可以使用项目根目录下的 `build.sh` 快速开始构建:
|
||||
|
||||
```shell
|
||||
./build.sh [-a] [-c] [-b] [-r]
|
||||
a - 构建静态资源
|
||||
c - 编译二进制文件
|
||||
b - 构建前端 + 编译二进制文件
|
||||
r - 交叉编译,构建用于release的版本
|
||||
goreleaser build --clean --single-target --snapshot
|
||||
```
|
||||
|
||||
## :alembic: 技术栈
|
||||
|
|
Loading…
Add table
Reference in a new issue