From ae6368f031ddc87af4c697f09cb1a7af409362bd Mon Sep 17 00:00:00 2001 From: Kuniwak Date: Mon, 13 May 2024 13:56:23 +0900 Subject: [PATCH] Goodbye unity-meta-check-bins because there are only few users of bins --- Makefile | 157 +----------------------------------------- scripts/deploy | 71 ------------------- scripts/deploy-bins | 77 --------------------- scripts/print-version | 6 -- 4 files changed, 1 insertion(+), 310 deletions(-) delete mode 100755 scripts/deploy delete mode 100755 scripts/deploy-bins delete mode 100755 scripts/print-version diff --git a/Makefile b/Makefile index d681947..bf442bb 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,3 @@ -all: darwin-amd64 linux-amd64 windows-amd64 darwin-arm64 linux-arm64 windows-arm64 - - clean: go clean git clean -fdx ./out @@ -9,157 +6,5 @@ clean: test: go test ./... -out: - mkdir -p ./out - - -# NOTE: meta-audit は Debug 用ツールなので必要になったら生成してください(生成されちゃうと Releases へあげるときに間引かないといけなくてめんどい) -darwin-amd64: out/unity-meta-check-darwin-amd64 out/unity-meta-check-junit-darwin-amd64 out/unity-meta-check-github-pr-comment-darwin-amd64 out/unity-meta-autofix-darwin-amd64 out/gh-action-yaml-gen-darwin-amd64 - -out/unity-meta-check-darwin-amd64: out - CGO_ENABLED=0 GOARCH=amd64 GOOS=darwin go build -v -o "$@" - -out/unity-meta-check-junit-darwin-amd64: out - CGO_ENABLED=0 GOARCH=amd64 GOOS=darwin go build -v -o "$@" ./tool/unity-meta-check-junit - -out/unity-meta-check-github-pr-comment-darwin-amd64: out - GOARCH=amd64 GOOS=darwin go build -a -tags netgo -installsuffix netgo -v -o "$@" ./tool/unity-meta-check-github-pr-comment - -out/unity-meta-check-meta-audit-darwin-amd64: out - CGO_ENABLED=0 GOARCH=amd64 GOOS=darwin go build -v -o "$@" ./tool/unity-meta-check-meta-audit - -out/unity-meta-autofix-darwin-amd64: out - CGO_ENABLED=0 GOARCH=amd64 GOOS=darwin go build -v -o "$@" ./tool/unity-meta-autofix - -out/gh-action-yaml-gen-darwin-amd64: out - CGO_ENABLED=0 GOARCH=amd64 GOOS=darwin go build -v -o "$@" ./tool/gh-action/action-yaml-gen - -out/gh-action-darwin-amd64: out - CGO_ENABLED=0 GOARCH=amd64 GOOS=darwin go build -v -o "$@" ./tool/gh-action - - -darwin-arm64: out/unity-meta-check-darwin-arm64 out/unity-meta-check-junit-darwin-arm64 out/unity-meta-check-github-pr-comment-darwin-arm64 out/unity-meta-autofix-darwin-arm64 out/gh-action-yaml-gen-darwin-arm64 - -out/unity-meta-check-darwin-arm64: out - CGO_ENABLED=0 GOARCH=arm64 GOOS=darwin go build -v -o "$@" - -out/unity-meta-check-junit-darwin-arm64: out - CGO_ENABLED=0 GOARCH=arm64 GOOS=darwin go build -v -o "$@" ./tool/unity-meta-check-junit - -out/unity-meta-check-github-pr-comment-darwin-arm64: out - GOARCH=arm64 GOOS=darwin go build -a -tags netgo -installsuffix netgo -v -o "$@" ./tool/unity-meta-check-github-pr-comment - -out/unity-meta-check-meta-audit-darwin-arm64: out - CGO_ENABLED=0 GOARCH=arm64 GOOS=darwin go build -v -o "$@" ./tool/unity-meta-check-meta-audit - -out/unity-meta-autofix-darwin-arm64: out - CGO_ENABLED=0 GOARCH=arm64 GOOS=darwin go build -v -o "$@" ./tool/unity-meta-autofix - -out/gh-action-yaml-gen-darwin-arm64: out - CGO_ENABLED=0 GOARCH=arm64 GOOS=darwin go build -v -o "$@" ./tool/gh-action/action-yaml-gen - -out/gh-action-darwin-arm64: out - CGO_ENABLED=0 GOARCH=arm64 GOOS=darwin go build -v -o "$@" ./tool/gh-action - - -# NOTE: meta-audit は Debug 用ツールなので必要になったら生成してください(生成されちゃうと Releases へあげるときに間引かないといけなくてめんどい) -linux-amd64: out/unity-meta-check-linux-amd64 out/unity-meta-check-junit-linux-amd64 out/unity-meta-check-github-pr-comment-linux-amd64 out/unity-meta-autofix-linux-amd64 out/gh-action-yaml-gen-linux-amd64 out/gh-action-linux-amd64 - -out/unity-meta-check-linux-amd64: out - CGO_ENABLED=0 GOARCH=amd64 GOOS=linux go build -v -o "$@" - -out/unity-meta-check-junit-linux-amd64: out - CGO_ENABLED=0 GOARCH=amd64 GOOS=linux go build -v -o "$@" ./tool/unity-meta-check-junit - -out/unity-meta-check-github-pr-comment-linux-amd64: out - GOARCH=amd64 GOOS=linux go build -a -tags netgo -installsuffix netgo -v -o "$@" ./tool/unity-meta-check-github-pr-comment - -out/unity-meta-check-meta-audit-linux-amd64: out - CGO_ENABLED=0 GOARCH=amd64 GOOS=linux go build -v -o "$@" ./tool/unity-meta-check-meta-audit - -out/unity-meta-autofix-linux-amd64: out - CGO_ENABLED=0 GOARCH=amd64 GOOS=linux go build -v -o "$@" ./tool/unity-meta-autofix - -out/gh-action-yaml-gen-linux-amd64: out - CGO_ENABLED=0 GOARCH=amd64 GOOS=linux go build -v -o "$@" ./tool/gh-action/action-yaml-gen - -out/gh-action-linux-amd64: out - CGO_ENABLED=0 GOARCH=amd64 GOOS=linux go build -v -o "$@" ./tool/gh-action - - -# NOTE: meta-audit は Debug 用ツールなので必要になったら生成してください(生成されちゃうと Releases へあげるときに間引かないといけなくてめんどい) -linux-arm64: out/unity-meta-check-linux-arm64 out/unity-meta-check-junit-linux-arm64 out/unity-meta-check-github-pr-comment-linux-arm64 out/unity-meta-autofix-linux-arm64 out/gh-action-yaml-gen-linux-arm64 out/gh-action-linux-arm64 - -out/unity-meta-check-linux-arm64: out - CGO_ENABLED=0 GOARCH=arm64 GOOS=linux go build -v -o "$@" - -out/unity-meta-check-junit-linux-arm64: out - CGO_ENABLED=0 GOARCH=arm64 GOOS=linux go build -v -o "$@" ./tool/unity-meta-check-junit - -out/unity-meta-check-github-pr-comment-linux-arm64: out - GOARCH=arm64 GOOS=linux go build -a -tags netgo -installsuffix netgo -v -o "$@" ./tool/unity-meta-check-github-pr-comment - -out/unity-meta-check-meta-audit-linux-arm64: out - CGO_ENABLED=0 GOARCH=arm64 GOOS=linux go build -v -o "$@" ./tool/unity-meta-check-meta-audit - -out/unity-meta-autofix-linux-arm64: out - CGO_ENABLED=0 GOARCH=arm64 GOOS=linux go build -v -o "$@" ./tool/unity-meta-autofix - -out/gh-action-yaml-gen-linux-arm64: out - CGO_ENABLED=0 GOARCH=arm64 GOOS=linux go build -v -o "$@" ./tool/gh-action/action-yaml-gen - -out/gh-action-linux-arm64: out - CGO_ENABLED=0 GOARCH=arm64 GOOS=linux go build -v -o "$@" ./tool/gh-action - - -# NOTE: meta-audit は Debug 用ツールなので必要になったら生成してください(生成されちゃうと Releases へあげるときに間引かないといけなくてめんどい) -windows-amd64: out/unity-meta-check-windows-amd64.exe out/unity-meta-check-junit-windows-amd64.exe out/unity-meta-check-github-pr-comment-windows-amd64.exe out/unity-meta-autofix-windows-amd64.exe out/gh-action-yaml-gen-windows-amd64.exe - -out/unity-meta-check-windows-amd64.exe: out - CGO_ENABLED=0 GOARCH=amd64 GOOS=windows go build -v -o "$@" - -out/unity-meta-check-junit-windows-amd64.exe: out - CGO_ENABLED=0 GOARCH=amd64 GOOS=windows go build -v -o "$@" ./tool/unity-meta-check-junit - -out/unity-meta-check-github-pr-comment-windows-amd64.exe: out - GOARCH=amd64 GOOS=windows go build -a -tags netgo -installsuffix netgo -v -o "$@" ./tool/unity-meta-check-github-pr-comment - -out/unity-meta-check-meta-audit-windows-amd64.exe: out - CGO_ENABLED=0 GOARCH=amd64 GOOS=windows go build -v -o "$@" ./tool/unity-meta-check-meta-audit - -out/unity-meta-autofix-windows-amd64.exe: out - CGO_ENABLED=0 GOARCH=amd64 GOOS=windows go build -v -o "$@" ./tool/unity-meta-autofix - -out/gh-action-yaml-gen-windows-amd64.exe: out - CGO_ENABLED=0 GOARCH=amd64 GOOS=windows go build -v -o "$@" ./tool/gh-action/action-yaml-gen - -out/gh-action-windows-amd64.exe: out - CGO_ENABLED=0 GOARCH=amd64 GOOS=linux go build -v -o "$@" ./tool/gh-action - - -# NOTE: meta-audit は Debug 用ツールなので必要になったら生成してください(生成されちゃうと Releases へあげるときに間引かないといけなくてめんどい) -windows-arm64: out/unity-meta-check-windows-arm64.exe out/unity-meta-check-junit-windows-arm64.exe out/unity-meta-check-github-pr-comment-windows-arm64.exe out/unity-meta-autofix-windows-arm64.exe out/gh-action-yaml-gen-windows-arm64.exe - -out/unity-meta-check-windows-arm64.exe: out - CGO_ENABLED=0 GOARCH=arm64 GOOS=windows go build -v -o "$@" - -out/unity-meta-check-junit-windows-arm64.exe: out - CGO_ENABLED=0 GOARCH=arm64 GOOS=windows go build -v -o "$@" ./tool/unity-meta-check-junit - -out/unity-meta-check-github-pr-comment-windows-arm64.exe: out - GOARCH=arm64 GOOS=windows go build -a -tags netgo -installsuffix netgo -v -o "$@" ./tool/unity-meta-check-github-pr-comment - -out/unity-meta-check-meta-audit-windows-arm64.exe: out - CGO_ENABLED=0 GOARCH=arm64 GOOS=windows go build -v -o "$@" ./tool/unity-meta-check-meta-audit - -out/unity-meta-autofix-windows-arm64.exe: out - CGO_ENABLED=0 GOARCH=arm64 GOOS=windows go build -v -o "$@" ./tool/unity-meta-autofix - -out/gh-action-yaml-gen-windows-arm64.exe: out - CGO_ENABLED=0 GOARCH=arm64 GOOS=windows go build -v -o "$@" ./tool/gh-action/action-yaml-gen - -out/gh-action-windows-arm64.exe: out - CGO_ENABLED=0 GOARCH=arm64 GOOS=linux go build -v -o "$@" ./tool/gh-action - -.PHONY: all test clean darwin-amd64 linux-amd64 windows-amd64 darwin-arm64 linux-arm64 windows-arm64 +.PHONY: test clean diff --git a/scripts/deploy b/scripts/deploy deleted file mode 100755 index f611863..0000000 --- a/scripts/deploy +++ /dev/null @@ -1,71 +0,0 @@ -#!/bin/bash -set -euo pipefail - -BASE_DIR="$(cd "$(dirname "$0")/.."; pwd)" - - -has() { - local cmd="$1" - which "$cmd" >/dev/null 2>&1 -} - - -echo-stderr() { - local message="$*" - printf "%s\n" "$message" 1>&2 -} - - -throw() { - local message="$*" - echo-stderr "error: $message" - false -} - - -usage() { - cat - 1>&2 <<-EOS -usage: deploy [] - -OPTIONS - -h, --help print this usage -EOS -} - - -usage-error() { - local message="$*" - echo-stderr "$message" - usage - false -} - - -main() { - has go || throw "'go' must be installed (see https://golang.org)" - - local version - version="$("$BASE_DIR/scripts/print-version")" - - go test ./... - - local tag="v${version}" - - if (git tag | grep -Fqx "$tag"); then - throw "a tag has the same name exists on local, so if still you want to overwrite the tag, please remove the tag on local and try again.: '$tag'" - fi - git tag "$tag" - - (cd "$BASE_DIR" - ./scripts/deploy-bins - ) -} - - -case "$*" in - --help | -h) - usage - false ;; - *) - main "$@" ;; -esac diff --git a/scripts/deploy-bins b/scripts/deploy-bins deleted file mode 100755 index d7367b6..0000000 --- a/scripts/deploy-bins +++ /dev/null @@ -1,77 +0,0 @@ -#!/bin/bash -set -euo pipefail - -BASE_DIR="$(cd "$(dirname "$0")/.."; pwd)" - - -echo-stderr() { - local message="$*" - printf "%s\n" "$message" 1>&2 -} - - -throw() { - local message="$*" - echo-stderr "error: $message" - false -} - - -usage() { - cat - 1>&2 <<-EOS -usage: deploy-bins [] - -OPTIONS - -h, --help print this usage -EOS -} - - -usage-error() { - local message="$*" - echo-stderr "$message" - usage - false -} - - -main() { - local version - version="$("$BASE_DIR/scripts/print-version")" - - local tag="v${version}" - - (cd "$BASE_DIR" - (git tag | grep -Fqx "$tag") || throw "tag does not exist: '$tag'" - git push origin "$tag" || throw "a tag has the same name exists on the remote, so if still you want to overwrite the tag, please remove the tag on the remote and try again." - - echo-stderr "DEPLOY TO UNITY-META-CHECK-BINS" - - mkdir -p ./tmp - cd ./tmp - if [[ -d ./unity-meta-check-bins ]]; then - cd ./unity-meta-check-bins - git pull origin master - else - git clone git@github.com:DeNA/unity-meta-check-bins - cd ./unity-meta-check-bins - fi - - ./unity-meta-check-build-toolchains "$tag" - git add . - git commit --allow-empty -m "Update executables to $tag" - - git push origin master - git tag "$tag" - git push origin "$tag" - ) -} - - -case "$*" in - --help | -h) - usage - false ;; - *) - main "$@" ;; -esac diff --git a/scripts/print-version b/scripts/print-version deleted file mode 100755 index f36c4ae..0000000 --- a/scripts/print-version +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash -set -euo pipefail - -BASE_DIR="$(cd "$(dirname "$0")/.."; pwd)" - -(cd "$BASE_DIR" && grep -o '[0-9]*\.[0-9]*\.[0-9]*\(-[a-zA-Z0-9_-]\+\)\?' ./version/version.go)