From afd90148cdf44caaece519fdacd85b1ded6b689e Mon Sep 17 00:00:00 2001 From: Xinwei Xiong <86140903+cubxxw@users.noreply.github.com> Date: Wed, 12 Jul 2023 23:32:17 +0800 Subject: [PATCH] fix: docs link (#91) * fix: docs link Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com> * feat: add COLOR_SUFFIX=033[0m # End all colors and special effects Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com> * feat: add the changelog Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com> * feat: add more openkf design Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com> * fix: add kubekf file Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com> * feat: add license Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com> * feat: add all file Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com> --------- Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com> --- .github/sync.yml | 6 ++ .github/workflows/kubekf.yml | 86 ++++++++++++++++--- .github/workflows/stale.yml | 1 - .github/workflows/sync.yml | 39 +++++++++ .gitignore | 2 +- CHANGELOG/.chglog/CHANGELOG.tpl.md | 62 ++++++++++++++ CHANGELOG/.chglog/config.yml | 66 +++++++++++++++ CHANGELOG/CHANGELOG-0.1.md | 71 ++++++++++++++++ CHANGELOG/CHANGELOG.md | 23 ++++++ CONTRIBUTING.md | 26 ++++-- DEVELOPGUIDE.md | 0 Makefile | 13 ++- README.md | 7 +- README_zh-CN.md | 127 +++++++++++++++++------------ assets/logo-gif/LICENSE | 1 + assets/logo/LICENSE | 1 + docs/CODEOWNERS | 12 +-- docs/OWNERS | 4 - docs/website/.gitignore | 16 ++++ docs/website/Makefile | 67 +++++++++++---- docs/website/README.md | 123 ++++++++++++++++++++++++++++ docs/website/theme.toml | 14 ++++ package-lock.json | 6 ++ 23 files changed, 671 insertions(+), 102 deletions(-) create mode 100644 .github/sync.yml create mode 100644 .github/workflows/sync.yml create mode 100644 CHANGELOG/.chglog/CHANGELOG.tpl.md create mode 100644 CHANGELOG/.chglog/config.yml create mode 100644 CHANGELOG/CHANGELOG-0.1.md create mode 100644 CHANGELOG/CHANGELOG.md delete mode 100644 DEVELOPGUIDE.md create mode 100644 assets/logo-gif/LICENSE create mode 100644 assets/logo/LICENSE delete mode 100644 docs/OWNERS create mode 100644 docs/website/README.md create mode 100644 docs/website/theme.toml create mode 100644 package-lock.json diff --git a/.github/sync.yml b/.github/sync.yml new file mode 100644 index 0000000..a53588e --- /dev/null +++ b/.github/sync.yml @@ -0,0 +1,6 @@ +# https://github.com/BetaHuhn/repo-file-sync-action +# Synchronization for the.github repository +openkf/openkf: + - source: ./ + dest: ./ + replace: true \ No newline at end of file diff --git a/.github/workflows/kubekf.yml b/.github/workflows/kubekf.yml index 5e7bc78..520a444 100644 --- a/.github/workflows/kubekf.yml +++ b/.github/workflows/kubekf.yml @@ -16,7 +16,25 @@ name: OpenKF CI on: push: + branches: + - main + paths-ignore: + - "docs/**" + - "README.md" + - "README_zh-CN.md" + - "CONTRIBUTING.md" pull_request: + branches: + - main + paths-ignore: + - "README.md" + - "README_zh-CN.md" + - "CONTRIBUTING.md" + - "docs/**" + +env: + GO_VERSION: "1.19" + GOLANGCI_VERSION: "v1.50.1" jobs: openkf: @@ -74,15 +92,59 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v1 - # skip for now - # - name: Login to DockerHub - # uses: docker/login-action@v1 - # with: - # username: ${{ env.DOCKERHUB_USERNAME }} - # password: ${{ secrets.DOCKERHUB_TOKEN }} - - # skip for now - # - name: Build docker images for host arch and push images to registry - # run: | - # set -e - # make docker-push + lint: + runs-on: ubuntu-20.04 + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Set up Go + uses: actions/setup-go@v3 + with: + go-version: ${{ env.GO_VERSION }} + + - name: golangci-lint + uses: golangci/golangci-lint-action@v3 + with: + version: ${{ env.GOLANGCI_VERSION }} + + docker-image-tests: + runs-on: ubuntu-20.04 + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Set up Go + uses: actions/setup-go@v3 + with: + go-version: ${{ env.GO_VERSION }} + + - name: Run tests + run: make build + + - name: Test docker image + run: | + docker build -t openkf:ci-build . + + goreleaser-test: + runs-on: ubuntu-20.04 + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Set up Go + uses: actions/setup-go@v3 + with: + go-version: ${{ env.GO_VERSION }} + + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v4 + with: + version: latest + args: release --clean --skip-publish --snapshot \ No newline at end of file diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index bd2003b..fa161bd 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -25,7 +25,6 @@ on: jobs: stale: - runs-on: ubuntu-latest permissions: issues: write diff --git a/.github/workflows/sync.yml b/.github/workflows/sync.yml new file mode 100644 index 0000000..d6e15bf --- /dev/null +++ b/.github/workflows/sync.yml @@ -0,0 +1,39 @@ +# Copyright © 2023 KubeCub open source community. All rights reserved. +# Licensed under the MIT License (the "License"); +# you may not use this file except in compliance with the License. + +# https://github.com/BetaHuhn/repo-file-sync-action +name: Synchronize kubecub public code to other repositories +on: + push: + branches: + - main + workflow_dispatch: + +jobs: + sync: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Run GitHub File Sync + uses: BetaHuhn/repo-file-sync-action@latest + with: + GH_INSTALLATION_TOKEN: "${{ secrets.BOT_GITHUB_TOKEN }}" + CONFIG_PATH: .github/sync.yml + ORIGINAL_MESSAGE: true + SKIP_PR: true + COMMIT_EACH_FILE: false + COMMIT_BODY: "🤖 kubbot to synchronize the warehouse" + GIT_EMAIL: "3293172751ysy@gmail.com" + GIT_USERNAME: "kubbot" + PR_BODY: 👌 kubecub provides automated community services + REVIEWERS: | + kubbot + cubxxw + PR_LABELS: | + file-sync + automerge + ASSIGNEES: | + kubbot \ No newline at end of file diff --git a/.gitignore b/.gitignore index 60e1a00..fac1e01 100644 --- a/.gitignore +++ b/.gitignore @@ -46,7 +46,7 @@ ### JetBrains ### # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 -.idea +.idea/ # User-specific stuff .idea/**/workspace.xml diff --git a/CHANGELOG/.chglog/CHANGELOG.tpl.md b/CHANGELOG/.chglog/CHANGELOG.tpl.md new file mode 100644 index 0000000..56f2684 --- /dev/null +++ b/CHANGELOG/.chglog/CHANGELOG.tpl.md @@ -0,0 +1,62 @@ +# Version logging for OpenKF + + + + + +{{ if .Versions -}} + +## [Unreleased] + +{{ if .Unreleased.CommitGroups -}} +{{ range .Unreleased.CommitGroups -}} +### {{ .Title }} +{{ range .Commits -}} +- {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ .Subject }} +{{ end }} +{{ end -}} +{{ end -}} +{{ end -}} + +{{ range .Versions }} + +## {{ if .Tag.Previous }}[{{ .Tag.Name }}]{{ else }}{{ .Tag.Name }}{{ end }} - {{ datetime "2006-01-02" .Tag.Date }} +{{ range .CommitGroups -}} +### {{ .Title }} +{{ range .Commits -}} +- {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ .Subject }} +{{ end }} +{{ end -}} + +{{- if .RevertCommits -}} +### Reverts +{{ range .RevertCommits -}} +- {{ .Revert.Header }} +{{ end }} +{{ end -}} + +{{- if .MergeCommits -}} +### Pull Requests +{{ range .MergeCommits -}} +- {{ .Header }} +{{ end }} +{{ end -}} + +{{- if .NoteGroups -}} +{{ range .NoteGroups -}} +### {{ .Title }} +{{ range .Notes }} +{{ .Body }} +{{ end }} +{{ end -}} +{{ end -}} +{{ end -}} + +{{- if .Versions }} +[Unreleased]: {{ .Info.RepositoryURL }}/compare/{{ $latest := index .Versions 0 }}{{ $latest.Tag.Name }}...HEAD +{{ range .Versions -}} +{{ if .Tag.Previous -}} +[{{ .Tag.Name }}]: {{ $.Info.RepositoryURL }}/compare/{{ .Tag.Previous.Name }}...{{ .Tag.Name }} +{{ end -}} +{{ end -}} +{{ end -}} \ No newline at end of file diff --git a/CHANGELOG/.chglog/config.yml b/CHANGELOG/.chglog/config.yml new file mode 100644 index 0000000..2073f5d --- /dev/null +++ b/CHANGELOG/.chglog/config.yml @@ -0,0 +1,66 @@ +bin: git +style: github +template: CHANGELOG.tpl.md +info: + title: CHANGELOG + repository_url: https://github.com/OpenIMSDK/OpenKF +options: + tag_filter_pattern: '^v' + sort: "date" + + commits: + filters: + Type: + - feat + - fix + - perf + - refactor + - docs + - test + - chore + - ci + - build + + commit_groups: + group_by: Type + sort_by: Title + title_order: + - feat + - fix + - perf + - refactor + - docs + - test + - chore + - ci + - build + + header: + pattern: "^(\\w*)(?:\\(([\\w\\$\\.\\-\\*\\s]*)\\))?\\:\\s(.*)$" + pattern_maps: + - Type + - Scope + - Subject + + issues: + prefix: + - # + + refs: + actions: + - Closes + - Fixes + + merges: + pattern: "^Merge branch '(\\w+)'$" + pattern_maps: + - Source + + reverts: + pattern: "^Revert \"([\\s\\S]*)\"$" + pattern_maps: + - Header + + notes: + keywords: + - BREAKING CHANGE \ No newline at end of file diff --git a/CHANGELOG/CHANGELOG-0.1.md b/CHANGELOG/CHANGELOG-0.1.md new file mode 100644 index 0000000..6a272d4 --- /dev/null +++ b/CHANGELOG/CHANGELOG-0.1.md @@ -0,0 +1,71 @@ +# Version logging for OpenKF + + + + + + +## [Unreleased] + +### Docs +- design openkf docs ([#68](https://github.com/OpenIMSDK/OpenKF/issues/68)) +- fix markdown link ([#65](https://github.com/OpenIMSDK/OpenKF/issues/65)) +- fix markdown link ([#64](https://github.com/OpenIMSDK/OpenKF/issues/64)) +- fix markdown link ([#63](https://github.com/OpenIMSDK/OpenKF/issues/63)) + +### Feat +- add COLOR_SUFFIX=033[0m # End all colors and special effects +- Add register api with dao cmd. ([#73](https://github.com/OpenIMSDK/OpenKF/issues/73)) +- add logo file of Xx design +- add logo file of Xx design +- add logo file of Xx design +- add roadmap file +- add proposal file +- modify issue-specification.md +- add issue specification +- issue20 +- add actions file +- **main:** optimize deployment ([#36](https://github.com/OpenIMSDK/OpenKF/issues/36)) +- **main:** optimize deployment ([#36](https://github.com/OpenIMSDK/OpenKF/issues/36)) +- **main:** release script file ([#52](https://github.com/OpenIMSDK/OpenKF/issues/52)) + +### Fix +- docs link + + + +## v0.1.0 - 2023-07-05 +### Docs +- update code owners file ([#50](https://github.com/OpenIMSDK/OpenKF/issues/50)) +- update README.md ([#43](https://github.com/OpenIMSDK/OpenKF/issues/43)) +- update readme and readme-zh ([#35](https://github.com/OpenIMSDK/OpenKF/issues/35)) + +### Feat +- Add hook interceptor & add cmd & some fix ([#24](https://github.com/OpenIMSDK/OpenKF/issues/24)) +- Support auto-signature. ([#49](https://github.com/OpenIMSDK/OpenKF/issues/49)) +- Add callback api. ([#45](https://github.com/OpenIMSDK/OpenKF/issues/45)) +- add a component to support rate limt control ([#29](https://github.com/OpenIMSDK/OpenKF/issues/29)) +- add prettier and eslint ([#18](https://github.com/OpenIMSDK/OpenKF/issues/18)) ([#30](https://github.com/OpenIMSDK/OpenKF/issues/30)) +- add script license ([#17](https://github.com/OpenIMSDK/OpenKF/issues/17)) +- Support send code with email. ([#15](https://github.com/OpenIMSDK/OpenKF/issues/15)) +- init plugin project. ([#14](https://github.com/OpenIMSDK/OpenKF/issues/14)) +- enhance automated review for codeowners ([#11](https://github.com/OpenIMSDK/OpenKF/issues/11)) +- init server project ([#5](https://github.com/OpenIMSDK/OpenKF/issues/5)) +- **main:** add swagger api make file ([#51](https://github.com/OpenIMSDK/OpenKF/issues/51)) +- **main:** unit test makefile ([#56](https://github.com/OpenIMSDK/OpenKF/issues/56)) +- **main:** initialize the OpenKF architecture + +### Fix +- Fix doc links. ([#41](https://github.com/OpenIMSDK/OpenKF/issues/41)) +- Fix golang ci piplines and docs. ([#39](https://github.com/OpenIMSDK/OpenKF/issues/39)) +- cicd err tidy mod +- golang ci +- make fix ([#33](https://github.com/OpenIMSDK/OpenKF/issues/33)) +- Fix CONTRIBUTING. ([#28](https://github.com/OpenIMSDK/OpenKF/issues/28)) +- codeql token +- **main:** fix cicd actions +- **main:** optimize actions +- **main:** optimize actions + + +[Unreleased]: https://github.com/OpenIMSDK/OpenKF/compare/v0.1.0...HEAD diff --git a/CHANGELOG/CHANGELOG.md b/CHANGELOG/CHANGELOG.md new file mode 100644 index 0000000..2c1c330 --- /dev/null +++ b/CHANGELOG/CHANGELOG.md @@ -0,0 +1,23 @@ +# Changelog + +All notable changes to this project will be documented in this file. + ++ [https://github.com/OpenIMSDK/OpenKF/releases](https://github.com/OpenIMSDK/OpenKF/releases) + +## command + +```bash +git-chglog --tag-filter-pattern 'v2.0.*' -o CHANGELOG-2.0.md +``` + +## create next tag + +```bash +git-chglog --next-tag 2.0.0 -o CHANGELOG.md +git commit -am "release 2.0.0" +git tag 2.0.0 +``` + +## Release version logs + ++ [OpenIM CHANGELOG-V0.1](CHANGELOG-0.1.md) \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 09f5fdc..7e5041a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -8,13 +8,24 @@ This document provides guidelines and best practices to help you contribute effe ## 📇Topics -- [What we expect of you](#What-we-expect-of-you) -- [Code of Conduct](#Code-of-Conduct) -- [Getting Started](#Getting-Started) -- [Style and Specification](#Style-and-Specification) -- [Engage to help anything](#Engage-to-help-anything) -- [Release version](#Release-version) -- [Contact Us](#Contact-Us) +- [Contributing to OpenKF](#contributing-to-openkf) + - [📇Topics](#topics) + - [What we expect of you](#what-we-expect-of-you) + - [Code of Conduct](#code-of-conduct) + - [Code and doc contribution](#code-and-doc-contribution) + - [Where should I start?](#where-should-i-start) + - [Design documents](#design-documents) + - [Getting Started](#getting-started) + - [Style and Specification](#style-and-specification) + - [Reporting security issues](#reporting-security-issues) + - [Reporting general issues](#reporting-general-issues) + - [Commit Rules](#commit-rules) + - [PR Description](#pr-description) + - [CI actions](#ci-actions) + - [Docs Contribution](#docs-contribution) + - [Engage to help anything](#engage-to-help-anything) + - [Release version](#release-version) + - [Contact Us](#contact-us) @@ -356,7 +367,6 @@ Try your best to keep every function has been tested, it keeps the function beha + [README.md](https://github.com/OpenIMSDK/OpenKF/blob/main/README.md): This file includes the basic information and instructions for getting started with OpenKF. + [CONTRIBUTING.md](https://github.com/OpenIMSDK/OpenKF/blob/main/CONTRIBUTING.md): This file contains guidelines for contributing to OpenKF's codebase, such as how to submit issues, pull requests, and code reviews. -+ [DEVELOPGUIDE.md](https://github.com/OpenIMSDK/OpenKF/blob/main/DEVELOPGUIDE.md): This file provides a more in-depth guide to developing OpenKF, including information on the project's architecture, coding conventions, and testing practices. + [Official Documentation](https://doc.rentsoft.cn/): This is the official documentation for OpenKF, which includes comprehensive information on all of its features, configuration options, and troubleshooting tips. **Please obey the following rules to better format the docs, which would greatly improve the reading experience.** diff --git a/DEVELOPGUIDE.md b/DEVELOPGUIDE.md deleted file mode 100644 index e69de29..0000000 diff --git a/Makefile b/Makefile index 8f64142..c374948 100644 --- a/Makefile +++ b/Makefile @@ -241,6 +241,7 @@ generate: @cd $(SERVER_DIR) && $(GO) generate ./... ## lint: Run go lint against code. +# go1.19+ .PHONY: lint lint: tools.verify.golangci-lint @echo "===========> Run golangci to lint source codes" @@ -422,6 +423,11 @@ install.kubeconform: install.gsemver: @$(GO) install github.com/arnaud-deprez/gsemver@latest +## install.hugo: Install hugo, used to generate website +.PHONY: install.hugo +install.hugo: + @$(GO) install github.com/gohugoio/hugo@latest + ## install.git-chglog: Install git-chglog, used to generate changelog .PHONY: install.git-chglog install.git-chglog: @@ -432,9 +438,14 @@ install.git-chglog: install.github-release: @$(GO) install github.com/github-release/github-release@latest +## install.goreleaser: Install goreleaser, used to release go program +.PHONY: install.goreleaser +install.goreleaser: + @$(GO) install github.com/goreleaser/goreleaser@latest + ## install.coscli: Install coscli, used to upload files to cos # example: ./coscli cp/sync -r /root/workspaces/OpenIMSDK/OpenKF/ cos://OpenIMSDK-1306374445/code/ -e cos.ap-hongkong.myqcloud.com -# https://cloud.tencent.com/document/product/436/71763 +# https://cloud.tencent.com/document/product/436/71763 # OpenIMSDK/* # - code/ # - docs/ diff --git a/README.md b/README.md index 5fa8c89..eb29d24 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,12 @@
-
+
+
+
diff --git a/README_zh-CN.md b/README_zh-CN.md
index c2c91cf..d62c7dc 100644
--- a/README_zh-CN.md
+++ b/README_zh-CN.md
@@ -1,82 +1,101 @@
-