From 16f3c8af931acb0069509754b132b75238e18cb8 Mon Sep 17 00:00:00 2001 From: Ryota Date: Wed, 5 Jan 2022 18:36:37 -0500 Subject: [PATCH] Remove static file and use goreleaser (#83) --- .github/workflows/build.yaml | 2 +- .goreleaser.yml | 7 ++++++- VERSION.txt | 1 - tools/prep-release.sh | 9 +++++++-- 4 files changed, 14 insertions(+), 5 deletions(-) delete mode 100644 VERSION.txt diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 8b6e5f8..316e788 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -12,7 +12,7 @@ on: - release/v* env: - GO_VERSION: 1.16.5 + GO_VERSION: 1.17.5 jobs: build: diff --git a/.goreleaser.yml b/.goreleaser.yml index bb3011e..fbcbe1e 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -2,8 +2,10 @@ builds: - id: importer binary: importer main: ./cmd/importer/main.go + env: + - CGO_ENABLED=0 hooks: - pre: ./tools/prep-release.sh + pre: ./tools/prep-release.sh {{ .Tag }} goos: - darwin - linux @@ -11,6 +13,9 @@ builds: goarch: - amd64 - arm64 + goarm: + - "6" + - "7" brews: - name: importer diff --git a/VERSION.txt b/VERSION.txt deleted file mode 100644 index 6da28dd..0000000 --- a/VERSION.txt +++ /dev/null @@ -1 +0,0 @@ -0.1.1 \ No newline at end of file diff --git a/tools/prep-release.sh b/tools/prep-release.sh index 1b6b3d3..420add7 100755 --- a/tools/prep-release.sh +++ b/tools/prep-release.sh @@ -5,5 +5,10 @@ __root_dir=$(dirname "$0")/.. # Fill in revision information git rev-parse --short HEAD >"$__root_dir"/internal/version/REVISION.txt -# Copy the version info in the root dir -cp "$__root_dir"/VERSION.txt "$__root_dir"/internal/version/VERSION.txt +# Assuming that tag value is provided as an argument, use that as the version +# information. If missing by any chance, this defaults to "unknown". +__tag=$1 +if [[ -z $__tag ]]; then + __tag="unknown" +fi +echo "$__tag" >"$__root_dir"/internal/version/VERSION.txt