From 7f4f7e40d074d4c263b80c3add9dab1666346b15 Mon Sep 17 00:00:00 2001 From: int7 Date: Sat, 8 Jun 2024 16:15:15 +0800 Subject: [PATCH] feat: bump v0.1.3 --- CHANGELOG.md | 11 ++++++ Makefile.cross-compiles | 20 ++++++---- go.mod | 6 +-- go.sum | 7 ++++ package.sh | 77 +++++++++++++++++++++---------------- pkg/util/version/version.go | 2 +- 6 files changed, 78 insertions(+), 45 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 59196d6..27116fd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,14 @@ +## v0.1.3 (2024-06-08) + +This release focuses on enhancing code readability, ensuring compliance with Golang standards, and upgrading our CI/CD infrastructure. We’ve also improved error handling mechanisms and updated dependencies to maintain security and performance. + +### Improvements +- **Code Readability**: Refactored code to enhance readability and maintainability. +- **Golang Standards Compliance**: Updated code to fully comply with Golang coding standards and best practices. +- **CI/CD Enhancements**: Improved CI/CD pipelines to ensure more reliable builds and deployments. +- **Error Handling**: Improved error handling mechanisms throughout the codebase. +- **Dependencies**: Updated dependencies to the latest versions for better security and performance. + ## v0.1.2 (2024-04-15) This release introduces a set of code optimizations, improvements to documentation, and an extension of the testing suite. This is a patch release and does not contain any breaking changes or new features. It is backwards compatible with v0.1.1. diff --git a/Makefile.cross-compiles b/Makefile.cross-compiles index 8b43bd0..ee86d48 100644 --- a/Makefile.cross-compiles +++ b/Makefile.cross-compiles @@ -1,19 +1,25 @@ export PATH := $(PATH):`go env GOPATH`/bin LDFLAGS := -s -w -os-archs=darwin:amd64 darwin:arm64 freebsd:amd64 linux:amd64 linux:arm linux:arm64 windows:amd64 windows:arm64 linux:mips64 linux:mips64le linux:mips:softfloat linux:mipsle:softfloat linux:riscv64 android:arm64 +os-archs=darwin:amd64 darwin:arm64 freebsd:amd64 linux:amd64 linux:arm linux:arm:6 linux:arm64 windows:amd64 windows:arm64 linux:mips64 linux:mips64le linux:mips:softfloat linux:mipsle:softfloat linux:riscv64 android:arm64 all: build build: app app: - @$(foreach n, $(os-archs),\ - os=$(shell echo "$(n)" | cut -d : -f 1);\ - arch=$(shell echo "$(n)" | cut -d : -f 2);\ - gomips=$(shell echo "$(n)" | cut -d : -f 3);\ - target_suffix=$${os}_$${arch};\ - echo "Build $${os}-$${arch}...";\ + @$(foreach n, $(os-archs), \ + os=$(shell echo "$(n)" | cut -d : -f 1); \ + arch=$(shell echo "$(n)" | cut -d : -f 2); \ + extra=$(shell echo "$(n)" | cut -d : -f 3); \ + flags=''; \ + target_suffix=$${os}_$${arch}; \ + if [ "$${os}" = "linux" ] && [ "$${arch}" = "arm" ] && [ "$${extra}" != "" ] ; then \ + flags=GOARM=$${extra}; \ + target_suffix=$${os}_$${arch}_$${extra}; \ + elif [ "$${os}" = "linux" ] && [ "$${arch}" = "mips" ] && [ "$${extra}" != "" ] ; then \ + flags=GOMIPS=$${extra}; \ + fi; \ env CGO_ENABLED=0 GOOS=$${os} GOARCH=$${arch} GOMIPS=$${gomips} go build -trimpath -ldflags "$(LDFLAGS)" -o ./release/tiny-frpc_$${target_suffix} ./cmd/frpc;\ env CGO_ENABLED=0 GOOS=$${os} GOARCH=$${arch} GOMIPS=$${gomips} go build -trimpath -ldflags "$(LDFLAGS)" -tags nssh -o ./release/tiny-frpc-ssh_$${target_suffix} ./cmd/frpc;\ echo "Build $${os}-$${arch} done";\ diff --git a/go.mod b/go.mod index ec9aa2d..7a60703 100644 --- a/go.mod +++ b/go.mod @@ -3,14 +3,14 @@ module github.com/gofrp/tiny-frpc go 1.21 require ( - github.com/pelletier/go-toml/v2 v2.2.1 + github.com/pelletier/go-toml/v2 v2.2.2 github.com/stretchr/testify v1.9.0 - golang.org/x/crypto v0.22.0 + golang.org/x/crypto v0.23.0 ) require ( github.com/davecgh/go-spew v1.1.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - golang.org/x/sys v0.19.0 // indirect + golang.org/x/sys v0.20.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index f09be45..4d94b18 100644 --- a/go.sum +++ b/go.sum @@ -3,6 +3,8 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pelletier/go-toml/v2 v2.2.1 h1:9TA9+T8+8CUCO2+WYnDLCgrYi9+omqKXyjDtosvtEhg= github.com/pelletier/go-toml/v2 v2.2.1/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs= +github.com/pelletier/go-toml/v2 v2.2.2 h1:aYUidT7k73Pcl9nb2gScu7NSrKCSHIDE89b3+6Wq+LM= +github.com/pelletier/go-toml/v2 v2.2.2/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -16,10 +18,15 @@ github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsT github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30= golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M= +golang.org/x/crypto v0.23.0 h1:dIJU/v2J8Mdglj/8rJ6UUOM3Zc9zLZxVZwwxMooUSAI= +golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= +golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.19.0 h1:+ThwsDv+tYfnJFhF4L8jITxu1tdTWRTZpdsWgEgjL6Q= golang.org/x/term v0.19.0/go.mod h1:2CuTdWZ7KHSQwUzKva0cbMg6q2DMI3Mmxp+gKJbskEk= +golang.org/x/term v0.20.0 h1:VnkxpohqXaOBYJtBmEppKUG6mXpi+4O6purfc2+sMhw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/package.sh b/package.sh index d618722..fa195f4 100755 --- a/package.sh +++ b/package.sh @@ -19,48 +19,57 @@ mkdir -p ./release/packages os_all='linux windows darwin freebsd android' arch_all='386 amd64 arm arm64 mips64 mips64le mips mipsle riscv64' +extra_all='_ 6' cd ./release for os in $os_all; do for arch in $arch_all; do - tiny_frpc_dir_name="tiny-frpc_${tiny_frpc_version}_${os}_${arch}" - tiny_frpc_path="./packages/tiny-frpc_${tiny_frpc_version}_${os}_${arch}" - - if [ "x${os}" = x"windows" ]; then - if [ ! -f "./tiny-frpc_${os}_${arch}.exe" ]; then - continue - fi - if [ ! -f "./tiny-frpc-ssh_${os}_${arch}.exe" ]; then - continue - fi - mkdir ${tiny_frpc_path} - mv ./tiny-frpc_${os}_${arch}.exe ${tiny_frpc_path}/tiny-frpc.exe - mv ./tiny-frpc-ssh_${os}_${arch}.exe ${tiny_frpc_path}/tiny-frpc-ssh.exe - else - if [ ! -f "./tiny-frpc_${os}_${arch}" ]; then - continue + for extra in $extra_all; do + suffix="${os}_${arch}" + if [ "x${extra}" != x"_" ]; then + suffix="${os}_${arch}_${extra}" fi - if [ ! -f "./tiny-frpc-ssh_${os}_${arch}" ]; then - continue + tiny_frpc_dir_name="tiny-frpc_${tiny_frpc_version}_${suffix}" + tiny_frpc_path="./packages/tiny-frpc_${tiny_frpc_version}_${suffix}" + + if [ "x${os}" = x"windows" ]; then + if [ ! -f "./tiny-frpc_${os}_${arch}.exe" ]; then + continue + fi + if [ ! -f "./tiny-frpc-ssh_${os}_${arch}.exe" ]; then + continue + fi + mkdir ${tiny_frpc_path} + mv ./tiny-frpc_${os}_${arch}.exe ${tiny_frpc_path}/frpc.exe + mv ./tiny-frpc-ssh_${os}_${arch}.exe ${tiny_frpc_path}/tiny-frpc-ssh.exe + else + if [ ! -f "./tiny-frpc_${suffix}" ]; then + continue + fi + if [ ! -f "./tiny-frpc-ssh_${suffix}" ]; then + continue + fi + mkdir ${tiny_frpc_path} + mv ./tiny-frpc_${suffix} ${tiny_frpc_path}/tiny-frpc + mv ./tiny-frpc-ssh_${suffix} ${tiny_frpc_path}/tiny-frpc-ssh fi - mkdir ${tiny_frpc_path} - mv ./tiny-frpc_${os}_${arch} ${tiny_frpc_path}/tiny-frpc - mv ./tiny-frpc-ssh_${os}_${arch} ${tiny_frpc_path}/tiny-frpc-ssh - fi - cp ../LICENSE ${tiny_frpc_path} - cp -f ../conf/frpc.toml ${tiny_frpc_path} + cp ../LICENSE ${tiny_frpc_path} + cp -f ../conf/frpc.toml ${tiny_frpc_path} - # packages - cd ./packages - if [ "x${os}" = x"windows" ]; then - zip -rq ${tiny_frpc_dir_name}.zip ${tiny_frpc_dir_name} - else - tar -zcf ${tiny_frpc_dir_name}.tar.gz ${tiny_frpc_dir_name} - fi - cd .. - rm -rf ${tiny_frpc_path} + # packages + cd ./packages + if [ "x${os}" = x"windows" ]; then + zip -rq ${tiny_frpc_dir_name}.zip ${tiny_frpc_dir_name} + echo "windows" + else + tar -zcf ${tiny_frpc_dir_name}.tar.gz ${tiny_frpc_dir_name} + echo "linux+mac" + fi + cd .. + rm -rf ${tiny_frpc_path} + done done done -cd - +cd - \ No newline at end of file diff --git a/pkg/util/version/version.go b/pkg/util/version/version.go index deca6aa..c8f707d 100644 --- a/pkg/util/version/version.go +++ b/pkg/util/version/version.go @@ -14,7 +14,7 @@ package version -var version = "0.1.2" +var version = "0.1.3" func Full() string { return version