|
26 | 26 | @echo " test to run service test"
|
27 | 27 | @echo " release to build and release current version"
|
28 | 28 | @echo " release-source to pack the source code"
|
29 |
| - @echo " release-headers to build and pack the headers source code for go 1.7" |
30 |
| - @echo " release-binary to build the static binary for go 1.7" |
31 | 29 | @echo " clean to clean the coverage files"
|
32 | 30 |
|
33 | 31 | all: check build unit release
|
@@ -146,60 +144,18 @@ test:
|
146 | 144 | pushd "./test"; go run *.go; popd
|
147 | 145 | @echo "ok"
|
148 | 146 |
|
149 |
| -release: release-source release-source-with-vendor release-headers release-binary |
| 147 | +release: release-source release-source-with-vendor |
150 | 148 |
|
151 | 149 | release-source:
|
152 | 150 | @echo "pack the source code"
|
153 | 151 | mkdir -p "release"
|
154 |
| - zip -FS "release/${PREFIX}-source-v${VERSION}.zip" ${FILES_TO_RELEASE} |
| 152 | + @zip -FS "release/${PREFIX}-source-v${VERSION}.zip" ${FILES_TO_RELEASE} |
155 | 153 | @echo "ok"
|
156 | 154 |
|
157 | 155 | release-source-with-vendor:
|
158 | 156 | @echo "pack the source code"
|
159 | 157 | mkdir -p "release"
|
160 |
| - zip -FS "release/${PREFIX}-source-with-vendor-v${VERSION}.zip" ${FILES_TO_RELEASE_WITH_VENDOR} |
161 |
| - @echo "ok" |
162 |
| - |
163 |
| -release-headers: release-headers-go-1.7 |
164 |
| - |
165 |
| -release-headers-go-1.7: |
166 |
| - @echo "build and pack the headers source code for go 1.7" |
167 |
| - mkdir -p "release" |
168 |
| - mkdir -p "/tmp/${PREFIX}-headers/" |
169 |
| - for file in ${FILES_TO_RELEASE}; do \ |
170 |
| - filepath="/tmp/${PREFIX}-headers/$$(dirname $${file})/binary.go"; \ |
171 |
| - mkdir -p "$$(dirname $${filepath})"; \ |
172 |
| - package_line=$$(cat "$${file}" | grep -E "^package"); \ |
173 |
| - echo -ne "//go:binary-only-package\n\n" > "$${filepath}"; \ |
174 |
| - echo -ne "$${package_line}" >> "$${filepath}"; \ |
175 |
| - done |
176 |
| - pushd "/tmp/${PREFIX}-headers/"; \ |
177 |
| - zip -r "/tmp/${PREFIX}-headers-v${VERSION}-go-1.7.zip" .; \ |
178 |
| - popd |
179 |
| - cp "/tmp/${PREFIX}-headers-v${VERSION}-go-1.7.zip" "release/" |
180 |
| - rm -f "/tmp/${PREFIX}-headers-v${VERSION}-go-1.7.zip" |
181 |
| - rm -rf "/tmp/${PREFIX}-headers" |
182 |
| - @echo "ok" |
183 |
| - |
184 |
| -release-binary: release-binary-go-1.7 |
185 |
| - |
186 |
| -release-binary-go-1.7: |
187 |
| - @echo "build the static binary for go 1.7" |
188 |
| - mkdir -p "release" |
189 |
| - for pkg in ${PKGS_TO_RELEASE}; do \ |
190 |
| - GOOS=linux GOARCH=amd64 go install $${pkg}; \ |
191 |
| - GOOS=darwin GOARCH=amd64 go install $${pkg}; \ |
192 |
| - GOOS=windows GOARCH=amd64 go install $${pkg}; \ |
193 |
| - done |
194 |
| - cross=(linux_amd64 darwin_amd64 windows_amd64); \ |
195 |
| - for os_arch in $${cross[@]}; do \ |
196 |
| - MAIN_GOPATH=$$(echo "${GOPATH}" | awk '{split($$1,p,":"); print(p[1])}'); \ |
197 |
| - pushd "$${MAIN_GOPATH}/pkg/$${os_arch}/github.com/yunify/qingcloud-sdk-go"; \ |
198 |
| - zip -r "/tmp/${PREFIX}-binary-v${VERSION}-$${os_arch}-go-1.7.zip" .; \ |
199 |
| - popd; \ |
200 |
| - cp "/tmp/${PREFIX}-binary-v${VERSION}-$${os_arch}-go-1.7.zip" "release/"; \ |
201 |
| - rm -f "/tmp/${PREFIX}-binary-v${VERSION}-$${os_arch}-go-1.7.zip"; \ |
202 |
| - done |
| 158 | + @zip -FS "release/${PREFIX}-source-with-vendor-v${VERSION}.zip" ${FILES_TO_RELEASE_WITH_VENDOR} |
203 | 159 | @echo "ok"
|
204 | 160 |
|
205 | 161 | clean:
|
|
0 commit comments