From ece70e1486e6e844fa7117fe160eda77498c16bf Mon Sep 17 00:00:00 2001 From: Xinwei Xiong <86140903+cubxxw@users.noreply.github.com> Date: Thu, 13 Jul 2023 00:28:24 +0800 Subject: [PATCH] feat: add the changelog (#96) * feat: add the changelog Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com> * fix: add kubekf file Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com> * docs: fix readme zh link Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com> * fix: fix actions error Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com> * feat: add release Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com> * Update release.yml Signed-off-by: Xinwei Xiong <86140903+cubxxw@users.noreply.github.com> --------- Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com> Signed-off-by: Xinwei Xiong <86140903+cubxxw@users.noreply.github.com> --- .github/workflows/kubekf.yml | 39 +----- .github/workflows/release.yml | 33 +++++ .gitignore | 3 +- .goreleaser.yaml | 245 ++++++++++++++++++++++++++++++++++ README_zh-CN.md | 6 +- 5 files changed, 284 insertions(+), 42 deletions(-) create mode 100644 .github/workflows/release.yml create mode 100644 .goreleaser.yaml diff --git a/.github/workflows/kubekf.yml b/.github/workflows/kubekf.yml index 520a444..c5cd524 100644 --- a/.github/workflows/kubekf.yml +++ b/.github/workflows/kubekf.yml @@ -45,7 +45,7 @@ jobs: strategy: matrix: - go_version: ["1.20"] + go_version: ["1.19","1.20"] os: [ubuntu-latest] steps: @@ -92,24 +92,6 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v1 - 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: @@ -129,22 +111,3 @@ jobs: - 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/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..0e4a03c --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,33 @@ +name: goreleaser + +on: + pull_request: + push: + +permissions: + contents: write + +jobs: + goreleaser: + runs-on: ubuntu-latest + steps: + - + name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - + name: Set up Go + uses: actions/setup-go@v4 + - + name: Run GoReleaser + uses: goreleaser/goreleaser-action@v4 + with: + # either 'goreleaser' (default) or 'goreleaser-pro' + distribution: goreleaser + version: latest + args: release --clean + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # Your GoReleaser Pro key, if you are using the 'goreleaser-pro' distribution + # GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }} diff --git a/.gitignore b/.gitignore index fac1e01..9e2de0e 100644 --- a/.gitignore +++ b/.gitignore @@ -353,4 +353,5 @@ dist .todo.md .note.md -# config files, may contain sensitive information \ No newline at end of file +# config files, may contain sensitive information +dist/ diff --git a/.goreleaser.yaml b/.goreleaser.yaml new file mode 100644 index 0000000..fd1b13f --- /dev/null +++ b/.goreleaser.yaml @@ -0,0 +1,245 @@ +# .goreleaser.yaml +builds: + # You can have multiple builds defined as a yaml list + - # + # ID of the build. + # + # Default: Binary name + id: "my-build" + + # Path to main.go file or main package. + # Notice: when used with `gomod.proxy`, this must be a package. + # + # Default is `.`. + main: ./server + + # Binary name. + # Can be a path (e.g. `bin/app`) to wrap the binary in a directory. + # + # Default: Project directory name + binary: program + + # Custom flags. + # + # Templates: allowed + flags: + - -tags=dev + - -v + + # Custom asmflags. + # + # Templates: allowed + asmflags: + - -D mysymbol + - all=-trimpath={{.Env.GOPATH}} + + # Custom gcflags. + # + # Templates: allowed + gcflags: + - all=-trimpath={{.Env.GOPATH}} + - ./dontoptimizeme=-N + + # Custom ldflags. + # + # Default: '-s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{.Date}} -X main.builtBy=goreleaser' + # Templates: allowed + ldflags: + - -s -w -X main.build={{.Version}} + - ./usemsan=-msan + + # Custom Go build mode. + # + # Valid options: + # - `c-shared` + # - `c-archive` + # + # Since: v1.13 + buildmode: c-shared + + # Custom build tags templates. + tags: + - osusergo + - netgo + - static_build + - feature + + # Custom environment variables to be set during the builds. + # Invalid environment variables will be ignored. + # + # Default: os.Environ() ++ env config section + # Templates: allowed (since v1.14) + env: + - CGO_ENABLED=0 + # complex, templated envs (v1.14+): + - >- + {{- if eq .Os "darwin" }} + {{- if eq .Arch "amd64"}}CC=o64-clang{{- end }} + {{- if eq .Arch "arm64"}}CC=aarch64-apple-darwin20.2-clang{{- end }} + {{- end }} + {{- if eq .Os "windows" }} + {{- if eq .Arch "amd64" }}CC=x86_64-w64-mingw32-gcc{{- end }} + {{- end }} + + # GOOS list to build for. + # For more info refer to: https://golang.org/doc/install/source#environment + # + # Default: [ 'darwin', 'linux', 'windows' ] + goos: + - freebsd + - windows + + # GOARCH to build for. + # For more info refer to: https://golang.org/doc/install/source#environment + # + # Default: [ '386', 'amd64', 'arm64' ] + goarch: + - amd64 + - arm + - arm64 + + # GOARM to build for when GOARCH is arm. + # For more info refer to: https://golang.org/doc/install/source#environment + # + # Default: [ 6 ] + goarm: + - 6 + - 7 + + # GOAMD64 to build when GOARCH is amd64. + # For more info refer to: https://golang.org/doc/install/source#environment + # + # Default: [ 'v1' ] + goamd64: + - v2 + - v3 + + # GOMIPS and GOMIPS64 to build when GOARCH is mips, mips64, mipsle or mips64le. + # For more info refer to: https://golang.org/doc/install/source#environment + # + # Default: [ 'hardfloat' ] + gomips: + - hardfloat + - softfloat + + # List of combinations of GOOS + GOARCH + GOARM to ignore. + ignore: + - goos: darwin + goarch: 386 + - goos: linux + goarch: arm + goarm: 7 + - goarm: mips64 + - gomips: hardfloat + - goamd64: v4 + + # Optionally override the matrix generation and specify only the final list + # of targets. + # + # Format is `{goos}_{goarch}` with their respective suffixes when + # applicable: `_{goarm}`, `_{goamd64}`, `_{gomips}`. + # + # Special values: + # - go_118_first_class: evaluates to the first-class ports of go1.18. + # - go_first_class: evaluates to latest stable go first-class ports, + # currently same as 1.18. + # + # This overrides `goos`, `goarch`, `goarm`, `gomips`, `goamd64` and + # `ignores`. + targets: + # Since: v1.9 + - go_first_class + # Since: v1.9 + - go_118_first_class + - linux_amd64_v1 + - darwin_arm64 + - linux_arm_6 + + # Set a specific go binary to use when building. + # It is safe to ignore this option in most cases. + # + # Default is "go" + gobinary: "go1.13.4" + + # Sets the command to run to build. + # Can be useful if you want to build tests, for example, + # in which case you can set this to "test". + # It is safe to ignore this option in most cases. + # + # Default: build. + # Since: v1.9 + command: test + + # Set the modified timestamp on the output binary, typically + # you would do this to ensure a build was reproducible. Pass + # empty string to skip modifying the output. + mod_timestamp: "{{ .CommitTimestamp }}" + + # Hooks can be used to customize the final binary, + # for example, to run generators. + # + # Templates: allowed + hooks: + pre: rice embed-go + post: ./script.sh {{ .Path }} + + # If true, skip the build. + # Useful for library projects. + skip: false + + # By default, GoReleaser will create your binaries inside + # `dist/${BuildID}_${BuildTarget}`, which is a unique directory per build + # target in the matrix. + # You can set subdirs within that folder using the `binary` property. + # + # However, if for some reason you don't want that unique directory to be + # created, you can set this property. + # If you do, you are responsible for keeping different builds from + # overriding each other. + no_unique_dist_dir: true + + # By default, GoReleaser will check if the main filepath has a main + # function. + # This can be used to skip that check, in case you're building tests, for + # example. + # + # Since: v1.9 + no_main_check: true + + # Path to project's (sub)directory containing Go code. + # This is the working directory for the Go build command(s). + # If dir does not contain a `go.mod` file, and you are using `gomod.proxy`, + # produced binaries will be invalid. + # You would likely want to use `main` instead of this. + # + # Default: '.' + dir: go + + # Builder allows you to use a different build implementation. + # This is a GoReleaser Pro feature. + # Valid options are: `go` and `prebuilt`. + # + # Default: 'go' + builder: prebuilt + + # Overrides allows to override some fields for specific targets. + # This can be specially useful when using CGO. + # Note: it'll only match if the full target matches. + # + # Since: v1.5 + overrides: + - goos: darwin + goarch: arm64 + goamd64: v1 + goarm: "" + gomips: "" + ldflags: + - foo + tags: + - bar + asmflags: + - foobar + gcflags: + - foobaz + env: + - CGO_ENABLED=1 diff --git a/README_zh-CN.md b/README_zh-CN.md index d62c7dc..43800e1 100644 --- a/README_zh-CN.md +++ b/README_zh-CN.md @@ -78,11 +78,11 @@ bashCopy Codemake all ## 🕋 架构图 -![架构](https://chat.jinshutuan.com/assets/images/architecture.png) +![架构](./assets/images/architecture.png) **MVC 架构设计:** -![MVC](https://chat.jinshutuan.com/assets/images/mvc.png) +![MVC](./assets/images/mvc.png) ## 🤖 文件目录说明 @@ -141,7 +141,7 @@ OpenIMSDK 的目标是打造一个顶级的开源社区。我们有一套标准 OpenIMSDK 使用 Apache 2.0 许可证。完整的许可证文本请参见 [LICENSE](https://github.com/OpenIMSDK/OpenKF/tree/main/LICENSE)。 -此存储库中显示的 OpenKF 标志(包括其变体和动画版本),存储在 [OpenKF](https://github.com/OpenIMSDK/openkf) 的 [assets/logo](https://chat.jinshutuan.com/assets/logo) 和 [assets/logo-gif](https://chat.jinshutuan.com/assets/logo-gif) 目录下,受版权法保护。 +此存储库中显示的 OpenKF 标志(包括其变体和动画版本),存储在 [OpenKF](https://github.com/OpenIMSDK/openkf) 的 [assets/logo](./assets/logo) 和 [assets/logo-gif](./assets/logo-gif) 目录下,受版权法保护。 ## 🔮 感谢我们的贡献者!