Skip to content

Commit

Permalink
Modify script
Browse files Browse the repository at this point in the history
  • Loading branch information
voidint committed Apr 3, 2022
1 parent 426c366 commit d027d1c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,15 @@ build-windows-arm:
build-windows-arm64:
GOOS=windows GOARCH=arm64 $(GO) build $(GO_FLAGS) -o bin/windows-arm64/g.exe

package:
sh ./package.sh

test:
$(GO) test -v ./...

clean:
$(GO) clean -x
rm -r bin
rm -f sha256sum.txt
rm -rf bin

.PHONY: all build install test clean build-linux build-darwin build-windows build-linux-386 build-linux-amd64 build-linux-arm build-linux-arm64 build-darwin-amd64 build-darwin-arm64 build-windows-386 build-windows-amd64 build-windows-arm build-windows-arm64
.PHONY: all build install test package clean build-linux build-darwin build-windows build-linux-386 build-linux-amd64 build-linux-arm build-linux-arm64 build-darwin-amd64 build-darwin-arm64 build-windows-386 build-windows-amd64 build-windows-arm build-windows-arm64
2 changes: 1 addition & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function get_os() {
}

main() {
local release="1.2.1"
local release="1.3.0"
local os=$(get_os)
local arch=$(get_arch)
local dest_file="${HOME}/g${release}.${os}-${arch}.tar.gz"
Expand Down
5 changes: 4 additions & 1 deletion package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,10 @@ function package() {
printf "[2/2] Package\n"
if [ ${os} == "windows" ]; then
zip g${release}.${os}-${arch}.zip ./g.exe
shasum -a 256 g${release}.${os}-${arch}.zip >> sha256sum.txt
else
tar -czv -f g${release}.${os}-${arch}.tar.gz ./g
shasum -a 256 g${release}.${os}-${arch}.tar.gz >> sha256sum.txt
fi
}

Expand All @@ -46,11 +48,12 @@ main() {
export GO111MODULE="on"
export GOPROXY="https://goproxy.cn,direct"

local release="1.2.1"
local release="1.3.0"

for item in "darwin_amd64" "darwin_arm64" "linux_386" "linux_amd64" "linux_arm" "linux_arm64" "windows_386" "windows_amd64" "windows_arm" "windows_arm64"; do
package ${release} ${item}
done

go clean
}

Expand Down

0 comments on commit d027d1c

Please sign in to comment.