From ee1327a27c3ad560b5819103fc8e0e3d52154a5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=87=91=E6=88=9F?= Date: Sat, 21 May 2022 13:58:50 +0800 Subject: [PATCH] refactor: update version tag during release packaging --- .dockerignore | 23 +++++++++++++---------- .gitignore | 4 ++-- Makefile | 6 +++--- build/scripts/docker.sh | 6 +++--- build/scripts/version.sh | 7 +++++++ 5 files changed, 28 insertions(+), 18 deletions(-) create mode 100644 build/scripts/version.sh diff --git a/.dockerignore b/.dockerignore index 9dbbed09..cdd6f7e8 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,12 +1,15 @@ -output -.github -.git -docs +# IDE files +*.iml +.idea/ +.vscode/ -.vscode -bin +# Unused files +output/ +.github/ +.git/ +docs/ +testing/ +cmd/ +pkg/ +hack/ .DS_Store - -# web build and modules -web/build -web/node_modules \ No newline at end of file diff --git a/.gitignore b/.gitignore index 086555df..e8f81715 100644 --- a/.gitignore +++ b/.gitignore @@ -2,8 +2,6 @@ *.iml .idea/ .vscode/ -.jvmrc -.DS_Store # Generated files vendor/ @@ -12,3 +10,5 @@ artifacts/ dist/ node_modules/ note/ +.jvmrc +.DS_Store diff --git a/Makefile b/Makefile index a474f086..f90f02b0 100644 --- a/Makefile +++ b/Makefile @@ -15,8 +15,8 @@ test: go test -v -cover -coverprofile artifacts/report/coverage/c.out ./... go tool cover -html=artifacts/report/coverage/c.out -o artifacts/report/coverage/index.html -# build kt project -compile: +# build kt release package +release: goreleaser --snapshot --skip-publish --rm-dist # check the style @@ -67,4 +67,4 @@ navigator-local: # clean up workspace clean: - rm -fr artifacts dist + rm -fr artifacts output dist diff --git a/build/scripts/docker.sh b/build/scripts/docker.sh index efbc801e..d6c24f41 100644 --- a/build/scripts/docker.sh +++ b/build/scripts/docker.sh @@ -2,12 +2,12 @@ for f in `ls build/docker`; do mkdir -p artifacts/docker/${f} - cp -f build/docker/${f}/Dockerfile artifacts/docker/${f}/Dockerfile + cp -f "build/docker/${f}/Dockerfile" "artifacts/docker/${f}/Dockerfile" if ! which gsed 2>&1 >/dev/null; then # Linux - sed -i 's#COPY artifacts/[a-z0-1]\+/#COPY #' artifacts/docker/${f}/Dockerfile + sed -i 's#COPY artifacts/[a-z0-1]\+/#COPY #' "artifacts/docker/${f}/Dockerfile" else # MacOS - gsed -i 's#COPY artifacts/[a-z0-1]\+/#COPY #' artifacts/docker/${f}/Dockerfile + gsed -i 's#COPY artifacts/[a-z0-1]\+/#COPY #' "artifacts/docker/${f}/Dockerfile" fi done diff --git a/build/scripts/version.sh b/build/scripts/version.sh new file mode 100644 index 00000000..b4bec38c --- /dev/null +++ b/build/scripts/version.sh @@ -0,0 +1,7 @@ +# Update version tag of Makefile + +if [ "${1}" != "" ]; then + sed -i "/^TAG/s/dev/${1}/" +else + echo "TAG should not be empty" +fi