forked from lazada/swgui
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrade to v3.51.1, add v4.0.0-beta.1 (#23)
- Loading branch information
Showing
45 changed files
with
800 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# This script is provided by github.com/bool64/dev. | ||
name: cloc | ||
on: | ||
pull_request: | ||
jobs: | ||
cloc: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
with: | ||
path: pr | ||
- name: Checkout base code | ||
uses: actions/checkout@v2 | ||
with: | ||
ref: ${{ github.event.pull_request.base.sha }} | ||
path: base | ||
- name: Count Lines Of Code | ||
id: loc | ||
run: | | ||
curl -OL https://github.com/vearutop/sccdiff/releases/download/v1.0.1/linux_amd64.tar.gz && tar xf linux_amd64.tar.gz | ||
OUTPUT=$(cd pr && ../sccdiff -basedir ../base) | ||
OUTPUT="${OUTPUT//'%'/'%25'}" | ||
OUTPUT="${OUTPUT//$'\n'/'%0A'}" | ||
OUTPUT="${OUTPUT//$'\r'/'%0D'}" | ||
echo "::set-output name=diff::$OUTPUT" | ||
- name: Comment Code Lines | ||
uses: marocchino/sticky-pull-request-comment@v2 | ||
with: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
header: LOC | ||
message: | | ||
### Lines Of Code | ||
${{ steps.loc.outputs.diff }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# This script is provided by github.com/bool64/dev. | ||
name: lint | ||
on: | ||
push: | ||
tags: | ||
- v* | ||
branches: | ||
- master | ||
- main | ||
pull_request: | ||
jobs: | ||
golangci: | ||
name: golangci-lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: golangci-lint | ||
uses: golangci/[email protected] | ||
with: | ||
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version. | ||
version: v1.41.1 | ||
|
||
# Optional: working directory, useful for monorepos | ||
# working-directory: somedir | ||
|
||
# Optional: golangci-lint command line arguments. | ||
# args: --issues-exit-code=0 | ||
|
||
# Optional: show only new issues if it's a pull request. The default value is `false`. | ||
# only-new-issues: true | ||
|
||
# Optional: if set to true then the action will use pre-installed Go. | ||
# skip-go-installation: true | ||
|
||
# Optional: if set to true then the action don't cache or restore ~/go/pkg. | ||
# skip-pkg-cache: true | ||
|
||
# Optional: if set to true then the action don't cache or restore ~/.cache/go-build. | ||
# skip-build-cache: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# This script is provided by github.com/bool64/dev. | ||
name: gorelease | ||
on: | ||
pull_request: | ||
env: | ||
GO111MODULE: "on" | ||
jobs: | ||
gorelease: | ||
strategy: | ||
matrix: | ||
go-version: [ 1.16.x ] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Install Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- name: Gorelease cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/go/bin/gorelease | ||
key: ${{ runner.os }}-gorelease | ||
- name: Gorelease | ||
id: gorelease | ||
run: | | ||
test -e ~/go/bin/gorelease || go install golang.org/x/exp/cmd/gorelease@latest | ||
OUTPUT=$(gorelease || exit 0) | ||
OUTPUT="${OUTPUT//'%'/'%25'}" | ||
OUTPUT="${OUTPUT//$'\n'/'%0A'}" | ||
OUTPUT="${OUTPUT//$'\r'/'%0D'}" | ||
echo "::set-output name=report::$OUTPUT" | ||
- name: Comment Gorelase Report | ||
uses: marocchino/sticky-pull-request-comment@v2 | ||
with: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
header: gorelease | ||
message: | | ||
### Exported API Changes Report | ||
<pre> | ||
${{ steps.gorelease.outputs.report }} | ||
</pre> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,5 @@ | ||
### Go template | ||
# Compiled Object files, Static and Dynamic libs (Shared Objects) | ||
*.o | ||
*.a | ||
*.so | ||
|
||
# Folders | ||
_obj | ||
_test | ||
|
||
# Architecture specific extensions/prefixes | ||
*.[568vq] | ||
[568vq].out | ||
|
||
*.cgo1.go | ||
*.cgo2.c | ||
_cgo_defun.c | ||
_cgo_gotypes.go | ||
_cgo_export.* | ||
|
||
_testmain.go | ||
|
||
*.exe | ||
*.test | ||
*.prof | ||
|
||
# Created by .ignore support plugin (hsz.mobi) | ||
|
||
/vendor/ | ||
/.idea | ||
/*.coverprofile | ||
/.vscode | ||
/bench-*.txt | ||
/vendor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# See https://github.com/golangci/golangci-lint/blob/master/.golangci.example.yml | ||
run: | ||
tests: true | ||
|
||
linters-settings: | ||
errcheck: | ||
check-type-assertions: true | ||
check-blank: true | ||
gocyclo: | ||
min-complexity: 20 | ||
dupl: | ||
threshold: 100 | ||
misspell: | ||
locale: US | ||
unused: | ||
check-exported: false | ||
unparam: | ||
check-exported: true | ||
|
||
linters: | ||
enable-all: true | ||
disable: | ||
- lll | ||
- maligned | ||
- gochecknoglobals | ||
- gomnd | ||
- wrapcheck | ||
- paralleltest | ||
- forbidigo | ||
- exhaustivestruct | ||
- interfacer # deprecated | ||
- forcetypeassert | ||
- scopelint # deprecated | ||
- ifshort # too many false positives | ||
- golint # deprecated | ||
|
||
issues: | ||
exclude-use-default: false | ||
exclude-rules: | ||
- linters: | ||
- revive | ||
text: var-naming | ||
- linters: | ||
- stylecheck | ||
text: ST1003 | ||
- linters: | ||
- gomnd | ||
- goconst | ||
- goerr113 | ||
- noctx | ||
- funlen | ||
- dupl | ||
path: "_test.go" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,67 @@ | ||
SWAGGER_UI_VERSION := v3.45.1 | ||
|
||
update: | ||
curl https://raw.githubusercontent.com/swagger-api/swagger-ui/$(SWAGGER_UI_VERSION)/dist/swagger-ui-bundle.js -o ./v3/static/swagger-ui-bundle.js | ||
curl https://raw.githubusercontent.com/swagger-api/swagger-ui/$(SWAGGER_UI_VERSION)/dist/swagger-ui-standalone-preset.js -o ./v3/static/swagger-ui-standalone-preset.js | ||
curl https://raw.githubusercontent.com/swagger-api/swagger-ui/$(SWAGGER_UI_VERSION)/dist/swagger-ui.js -o ./v3/static/swagger-ui.js | ||
curl https://raw.githubusercontent.com/swagger-api/swagger-ui/$(SWAGGER_UI_VERSION)/dist/swagger-ui.css -o ./v3/static/swagger-ui.css | ||
curl https://raw.githubusercontent.com/swagger-api/swagger-ui/$(SWAGGER_UI_VERSION)/dist/oauth2-redirect.html -o ./v3/static/oauth2-redirect.html | ||
curl https://raw.githubusercontent.com/swagger-api/swagger-ui/$(SWAGGER_UI_VERSION)/dist/favicon-32x32.png -o ./v3/static/favicon-32x32.png | ||
curl https://raw.githubusercontent.com/swagger-api/swagger-ui/$(SWAGGER_UI_VERSION)/dist/favicon-16x16.png -o ./v3/static/favicon-16x16.png | ||
#GOLANGCI_LINT_VERSION := "v1.41.1" # Optional configuration to pinpoint golangci-lint version. | ||
|
||
# The head of Makefile determines location of dev-go to include standard targets. | ||
GO ?= go | ||
export GO111MODULE = on | ||
|
||
ifneq "$(GOFLAGS)" "" | ||
$(info GOFLAGS: ${GOFLAGS}) | ||
endif | ||
|
||
ifneq "$(wildcard ./vendor )" "" | ||
$(info Using vendor) | ||
modVendor = -mod=vendor | ||
ifeq (,$(findstring -mod,$(GOFLAGS))) | ||
export GOFLAGS := ${GOFLAGS} ${modVendor} | ||
endif | ||
ifneq "$(wildcard ./vendor/github.com/bool64/dev)" "" | ||
DEVGO_PATH := ./vendor/github.com/bool64/dev | ||
endif | ||
endif | ||
|
||
ifeq ($(DEVGO_PATH),) | ||
DEVGO_PATH := $(shell GO111MODULE=on $(GO) list ${modVendor} -f '{{.Dir}}' -m github.com/bool64/dev) | ||
ifeq ($(DEVGO_PATH),) | ||
$(info Module github.com/bool64/dev not found, downloading.) | ||
DEVGO_PATH := $(shell export GO111MODULE=on && $(GO) mod tidy && $(GO) list -f '{{.Dir}}' -m github.com/bool64/dev) | ||
endif | ||
endif | ||
|
||
-include $(DEVGO_PATH)/makefiles/main.mk | ||
-include $(DEVGO_PATH)/makefiles/lint.mk | ||
-include $(DEVGO_PATH)/makefiles/reset-ci.mk | ||
|
||
# Add your custom targets here. | ||
|
||
SWAGGER_UI_VERSION_V3 := v3.51.1 | ||
SWAGGER_UI_VERSION_V4 := v4.0.0-beta.1 | ||
|
||
## Update assets for Swagger UI v3 | ||
update-v3: | ||
curl https://raw.githubusercontent.com/swagger-api/swagger-ui/$(SWAGGER_UI_VERSION_V3)/dist/swagger-ui-bundle.js -o ./v3/static/swagger-ui-bundle.js | ||
curl https://raw.githubusercontent.com/swagger-api/swagger-ui/$(SWAGGER_UI_VERSION_V3)/dist/swagger-ui-standalone-preset.js -o ./v3/static/swagger-ui-standalone-preset.js | ||
curl https://raw.githubusercontent.com/swagger-api/swagger-ui/$(SWAGGER_UI_VERSION_V3)/dist/swagger-ui.js -o ./v3/static/swagger-ui.js | ||
curl https://raw.githubusercontent.com/swagger-api/swagger-ui/$(SWAGGER_UI_VERSION_V3)/dist/swagger-ui.css -o ./v3/static/swagger-ui.css | ||
curl https://raw.githubusercontent.com/swagger-api/swagger-ui/$(SWAGGER_UI_VERSION_V3)/dist/oauth2-redirect.html -o ./v3/static/oauth2-redirect.html | ||
curl https://raw.githubusercontent.com/swagger-api/swagger-ui/$(SWAGGER_UI_VERSION_V3)/dist/favicon-32x32.png -o ./v3/static/favicon-32x32.png | ||
curl https://raw.githubusercontent.com/swagger-api/swagger-ui/$(SWAGGER_UI_VERSION_V3)/dist/favicon-16x16.png -o ./v3/static/favicon-16x16.png | ||
rm -rf ./v3/static/*.gz | ||
go run ./v3/gen/gen.go | ||
zopfli --i50 ./v3/static/*.js && rm -f ./v3/static/*.js | ||
zopfli --i50 ./v3/static/*.css && rm -f ./v3/static/*.css | ||
zopfli --i50 ./v3/static/*.html && rm -f ./v3/static/*.html | ||
|
||
## Update assets for Swagger UI v4 | ||
update-v4: | ||
curl https://raw.githubusercontent.com/swagger-api/swagger-ui/$(SWAGGER_UI_VERSION_V4)/dist/swagger-ui-bundle.js -o ./v4/static/swagger-ui-bundle.js | ||
curl https://raw.githubusercontent.com/swagger-api/swagger-ui/$(SWAGGER_UI_VERSION_V4)/dist/swagger-ui-standalone-preset.js -o ./v4/static/swagger-ui-standalone-preset.js | ||
curl https://raw.githubusercontent.com/swagger-api/swagger-ui/$(SWAGGER_UI_VERSION_V4)/dist/swagger-ui.js -o ./v4/static/swagger-ui.js | ||
curl https://raw.githubusercontent.com/swagger-api/swagger-ui/$(SWAGGER_UI_VERSION_V4)/dist/swagger-ui.css -o ./v4/static/swagger-ui.css | ||
curl https://raw.githubusercontent.com/swagger-api/swagger-ui/$(SWAGGER_UI_VERSION_V4)/dist/oauth2-redirect.html -o ./v4/static/oauth2-redirect.html | ||
curl https://raw.githubusercontent.com/swagger-api/swagger-ui/$(SWAGGER_UI_VERSION_V4)/dist/favicon-32x32.png -o ./v4/static/favicon-32x32.png | ||
curl https://raw.githubusercontent.com/swagger-api/swagger-ui/$(SWAGGER_UI_VERSION_V4)/dist/favicon-16x16.png -o ./v4/static/favicon-16x16.png | ||
rm -rf ./v4/static/*.gz | ||
go run ./v4/gen/gen.go | ||
zopfli --i50 ./v4/static/*.js && rm -f ./v4/static/*.js | ||
zopfli --i50 ./v4/static/*.css && rm -f ./v4/static/*.css | ||
zopfli --i50 ./v4/static/*.html && rm -f ./v4/static/*.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
package swgui_test | ||
|
||
import _ "github.com/bool64/dev" // Include CI/Dev scripts to project. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
module github.com/swaggest/swgui | ||
|
||
require ( | ||
github.com/bool64/dev v0.1.37 | ||
github.com/shurcooL/httpfs v0.0.0-20190707220628-8d4bc4ba7749 // indirect | ||
github.com/shurcooL/httpgzip v0.0.0-20190720172056-320755c1c1b0 | ||
github.com/shurcooL/vfsgen v0.0.0-20181202132449-6a9ea43bcacd | ||
github.com/vearutop/statigz v1.1.3 | ||
golang.org/x/net v0.0.0-20210326220855-61e056675ecf // indirect | ||
golang.org/x/tools v0.1.0 // indirect | ||
github.com/vearutop/statigz v1.1.4 | ||
golang.org/x/net v0.0.0-20210716203947-853a461950ff // indirect | ||
golang.org/x/tools v0.1.5 // indirect | ||
) |
Oops, something went wrong.