package script update
set -euo pipefail
+. $(dirname $0)/commons.sh
+
SCRIPTS_DIR="$(cd -P "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
BUILD_DIR="${SCRIPTS_DIR}/../dist/"
SOURCE_DIR="${SCRIPTS_DIR}/../"
NAME="azuredevops"
-BUILD_ARTIFACT="terraform-provider-${NAME}_${VERSION}"
+BUILD_ARTIFACT="terraform-provider-${NAME}_v${VERSION}"
+ARCHIVE_ARTIFACT="terraform-provider-${NAME}_${VERSION}"
OS_ARCH=("freebsd:amd64"
"freebsd:386"
@@ -41,32 +44,15 @@ function release() {
info "GOOS: ${OS}, GOARCH: ${ARCH}"
(
env GOOS="${OS}" GOARCH="${ARCH}" go build -o "${BUILD_ARTIFACT}"
- zip "${BUILD_ARTIFACT}_${OS}_${ARCH}.zip" "${BUILD_ARTIFACT}"
-# tar -cf "${BUILD_ARTIFACT}_${OS}_${ARCH}.tar" "${BUILD_ARTIFACT}"
+ zip "${ARCHIVE_ARTIFACT}_${OS}_${ARCH}.zip" "${BUILD_ARTIFACT}"
rm -rf ${BUILD_ARTIFACT}
)
done
mv *.zip ${BUILD_DIR}
cd ${BUILD_DIR}
- shasum -a 256 *.zip > "${BUILD_ARTIFACT}_SHA256SUMS"
- cat "${BUILD_ARTIFACT}_SHA256SUMS"
- ls -al
-
-}
-
-function log() {
- LEVEL="$1"
- shift
- echo "[$LEVEL] $@"
-}
-
-function info() {
- log "INFO" $@
-}
-
-function fatal() {
- log "FATAL" $@
- exit 1
+ shasum -a 256 *.zip > "${ARCHIVE_ARTIFACT}_SHA256SUMS"
+ cp "${ARCHIVE_ARTIFACT}_SHA256SUMS" "${ARCHIVE_ARTIFACT}_SHA256SUMS.sig"
+ cat "${ARCHIVE_ARTIFACT}_SHA256SUMS"
}
release
