Skip to content

Commit

Permalink
Merge branch 'github-main' into feature-plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
LinkinStars committed Feb 6, 2023
2 parents 9de9282 + a7a8cbf commit 9c2d2b1
Show file tree
Hide file tree
Showing 89 changed files with 37,821 additions and 1,359 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_dockerhub_img.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:

jobs:
build:
runs-on: ubuntu-latest
runs-on: [self-hosted, linux]
steps:
- name: Checkout
uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_github_img.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ env:

jobs:
build-and-push:
runs-on: ubuntu-latest
runs-on: [self-hosted, linux]

permissions:
packages: write
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/go_build_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:

jobs:
build-and-push:
runs-on: ubuntu-latest
runs-on: [self-hosted, linux]

steps:
- name: Checkout
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/node_build_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ on:

jobs:
build-and-push:
runs-on: ubuntu-latest

runs-on: [self-hosted, linux]
steps:
- name: Checkout
uses: actions/checkout@v3
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
/go.work*
/logs
/ui/node_modules
/ui/build/*/*/*
/ui/build/*.json
/ui/build/*.html
/ui/build/*.txt
/vendor
Thumbs*.db
tmp
Expand Down
38 changes: 3 additions & 35 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,50 +16,25 @@ builds:
- linux
goarch:
- amd64
# linux windows need cgomingw64-gcc
- id: build-windows
main: ./cmd/answer/.
binary: answer
ldflags: -s -w -X main.Version={{.Version}} -X main.Revision={{.ShortCommit}} -X main.Time={{.Date}} -X main.BuildUser=goreleaser
env:
- CC=x86_64-w64-mingw32-gcc
- CXX=x86_64-w64-mingw32-g++
goos:
- windows
goarch:
- amd64
# linux arm64 need cgo arm64
- id: build-arm64
main: ./cmd/answer/.
binary: answer
ldflags: -s -w -X main.Version={{.Version}} -X main.Revision={{.ShortCommit}} -X main.Time={{.Date}} -X main.BuildUser=goreleaser
env:
- CC=aarch64-linux-gnu-gcc
- CXX=aarch64-linux-gnu-g++
goos:
- linux
goarch:
- arm64
- id: build-arm7
main: ./cmd/answer/.
binary: answer
ldflags: -s -w -X main.Version={{.Version}} -X main.Revision={{.ShortCommit}} -X main.Time={{.Date}} -X main.BuildUser=goreleaser
env:
- CC=arm-linux-gnueabihf-gcc
- CXX=arm-linux-gnueabihf-g++
- AR=arm-linux-gnueabihf-ar
goos:
- linux
goarch:
- arm
goarm:
- 7
- id: build-darwin-arm64
main: ./cmd/answer/.
binary: answer
env:
- CC=oa64-clang
- CXX=oa64-clang++
goos:
- darwin
goarch:
Expand All @@ -69,9 +44,6 @@ builds:
- id: build-darwin-amd64
main: ./cmd/answer/.
binary: answer
env:
- CC=o64-clang
- CXX=o64-clang++
goos:
- darwin
goarch:
Expand All @@ -82,8 +54,10 @@ builds:

archives:
- replacements:
darwin: Darwin
darwin: macOS
amd64: x86_64
linux: Linux
windows: Windows
checksum:
name_template: 'checksums.txt'
snapshot:
Expand All @@ -95,10 +69,4 @@ changelog:
- '^docs:'
- '^test:'


# sudo apt-get install build-essential
# sudo apt-get install gcc-multilib g++-multilib
# sudo apt-get install gcc-mingw-w64
# sudo apt-get -y install gcc-aarch64-linux-gnu gcc-arm-linux-gnueabihf
# sudo apt-get install clang llvm
# goreleaser release --snapshot --rm-dist
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.PHONY: build clean ui

VERSION=1.0.3
VERSION=1.0.4
BIN=answer
DIR_SRC=./cmd/answer
DOCKER_CMD=docker
Expand All @@ -23,6 +23,8 @@ universal: generate
generate:
@$(GO) get github.com/google/wire/cmd/[email protected]
@$(GO) get github.com/golang/mock/[email protected]
@$(GO) install github.com/google/wire/cmd/[email protected]
@$(GO) install github.com/golang/mock/[email protected]
@$(GO) generate ./...
@$(GO) mod tidy

Expand All @@ -39,6 +41,6 @@ install-ui-packages:
@corepack prepare [email protected] --activate

ui:
@cd ui && pnpm install && pnpm build && cd -
@cd ui && pnpm install && pnpm build && sed -i 's/%AnswerVersion%/'$(VERSION)'/g' ./build/index.html && cd -

all: clean build
5 changes: 5 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Security Policy

## Reporting a Vulnerability

Please report security issues to `[email protected]`
59 changes: 9 additions & 50 deletions docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -5808,8 +5808,7 @@ const docTemplate = `{
"type": "object",
"required": [
"object_id",
"original_text",
"parsed_text"
"original_text"
],
"properties": {
"mention_username_list": {
Expand All @@ -5825,11 +5824,9 @@ const docTemplate = `{
},
"original_text": {
"description": "original comment content",
"type": "string"
},
"parsed_text": {
"description": "parsed comment content",
"type": "string"
"type": "string",
"maxLength": 600,
"minLength": 2
},
"reply_comment_id": {
"description": "reply comment id",
Expand Down Expand Up @@ -5923,17 +5920,11 @@ const docTemplate = `{
],
"properties": {
"content": {
"description": "content",
"type": "string",
"maxLength": 65535,
"minLength": 6
},
"html": {
"description": "html",
"type": "string"
},
"question_id": {
"description": "question_id",
"type": "string"
}
}
Expand All @@ -5945,29 +5936,20 @@ const docTemplate = `{
],
"properties": {
"content": {
"description": "content",
"type": "string",
"maxLength": 65535,
"minLength": 6
},
"edit_summary": {
"description": "edit_summary",
"type": "string"
},
"html": {
"description": "html",
"type": "string"
},
"id": {
"description": "id",
"type": "string"
},
"question_id": {
"description": "question_id",
"type": "string"
},
"title": {
"description": "title",
"type": "string"
}
}
Expand Down Expand Up @@ -7142,7 +7124,6 @@ const docTemplate = `{
"type": "object",
"required": [
"content",
"html",
"tags",
"title"
],
Expand All @@ -7153,12 +7134,6 @@ const docTemplate = `{
"maxLength": 65535,
"minLength": 6
},
"html": {
"description": "html",
"type": "string",
"maxLength": 65535,
"minLength": 6
},
"tags": {
"description": "tags",
"type": "array",
Expand Down Expand Up @@ -7291,7 +7266,6 @@ const docTemplate = `{
"type": "object",
"required": [
"content",
"html",
"id",
"tags",
"title"
Expand All @@ -7307,12 +7281,6 @@ const docTemplate = `{
"description": "edit summary",
"type": "string"
},
"html": {
"description": "html",
"type": "string",
"maxLength": 65535,
"minLength": 6
},
"id": {
"description": "question id",
"type": "string"
Expand Down Expand Up @@ -7878,10 +7846,6 @@ const docTemplate = `{
"description": "original text",
"type": "string"
},
"parsed_text": {
"description": "parsed text",
"type": "string"
},
"slug_name": {
"description": "slug_name",
"type": "string",
Expand Down Expand Up @@ -7979,7 +7943,8 @@ const docTemplate = `{
"schema.UpdateCommentReq": {
"type": "object",
"required": [
"comment_id"
"comment_id",
"original_text"
],
"properties": {
"comment_id": {
Expand All @@ -7988,11 +7953,9 @@ const docTemplate = `{
},
"original_text": {
"description": "original comment content",
"type": "string"
},
"parsed_text": {
"description": "parsed comment content",
"type": "string"
"type": "string",
"maxLength": 600,
"minLength": 2
}
}
},
Expand Down Expand Up @@ -8138,10 +8101,6 @@ const docTemplate = `{
"description": "original text",
"type": "string"
},
"parsed_text": {
"description": "parsed text",
"type": "string"
},
"slug_name": {
"description": "slug_name",
"type": "string",
Expand Down
Loading

0 comments on commit 9c2d2b1

Please sign in to comment.