From e30558aa2a23d818f496be51ce3d142068b7f47c Mon Sep 17 00:00:00 2001 From: Nitin Goel Date: Thu, 5 Oct 2023 11:55:52 +0530 Subject: [PATCH 1/5] adding sha256sum --- make.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/make.sh b/make.sh index ecbcca3699..093f7bb5be 100755 --- a/make.sh +++ b/make.sh @@ -236,6 +236,7 @@ package() { _ensure_enter_dir "${versioned_build_dir}" _tar --transform "s,^./,${versioned_name}/," -czf "${pkg_path}" ./* + sha256sum "${pkg_path}" > "${pkg_path}.SHA256" _exit_dir echo "> package: ${pkg_path}" @@ -1165,7 +1166,7 @@ get_rust_triplet() { } _sign() { - # TODO: generate sha sums and sign + # TODO: sign : } From 5e369501726ac46b929b5870ed6ccd7337e5a205 Mon Sep 17 00:00:00 2001 From: Nitin Goel Date: Mon, 16 Oct 2023 09:41:45 +0530 Subject: [PATCH 2/5] adding zip package for windows and shasum --- make.sh | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/make.sh b/make.sh index 093f7bb5be..8d4b8c4bdb 100755 --- a/make.sh +++ b/make.sh @@ -218,10 +218,13 @@ package() { local build_dir="${BUILD_DIR}" local pkg_name="${img_prefix}-${img_version}-${target}" - local pkg_tar_file_name="${pkg_name}.tar.gz" local pkg_path - pkg_path="$(_canonicalize "${build_dir}/${pkg_tar_file_name}")" + if [[ "${TARGET}" == "x86_64-w64-mingw32" ]]; then + pkg_path="$(_canonicalize "${build_dir}/"${pkg_name}.zip"")" + else + pkg_path="$(_canonicalize "${build_dir}/"${pkg_name}.tar.gz"")" + fi local versioned_name="${img_prefix}-${img_version}" local versioned_build_dir="${build_dir}/${versioned_name}" @@ -234,8 +237,14 @@ package() { echo "> packaging: ${pkg_name} from ${versioned_build_dir}" - _ensure_enter_dir "${versioned_build_dir}" - _tar --transform "s,^./,${versioned_name}/," -czf "${pkg_path}" ./* + + if [[ "${TARGET}" == "x86_64-w64-mingw32" ]]; then + _ensure_enter_dir "${build_dir}" + zip -r "${pkg_path}" "${versioned_build_dir}/" + else + _ensure_enter_dir "${versioned_build_dir}" + _tar --transform "s,^./,${versioned_name}/," -czf "${pkg_path}" ./* + fi sha256sum "${pkg_path}" > "${pkg_path}.SHA256" _exit_dir From a1e61239689b77630d1eabc169eef771a7506314 Mon Sep 17 00:00:00 2001 From: Nitin Goel Date: Mon, 16 Oct 2023 09:56:33 +0530 Subject: [PATCH 3/5] removing zip and shasum step from workflow files --- .github/workflows/build-release.yaml | 23 +---------------------- .github/workflows/build-staging.yaml | 23 +---------------------- 2 files changed, 2 insertions(+), 44 deletions(-) diff --git a/.github/workflows/build-release.yaml b/.github/workflows/build-release.yaml index 69bea3660d..60a3f69558 100644 --- a/.github/workflows/build-release.yaml +++ b/.github/workflows/build-release.yaml @@ -87,7 +87,7 @@ jobs: uses: actions/upload-artifact@v3 with: name: defichain-${{ env.BUILD_VERSION }}-x86_64-w64-mingw32 - path: ./build/defichain-${{ env.BUILD_VERSION }}-x86_64-w64-mingw32.tar.gz + path: ./build/defichain-${{ env.BUILD_VERSION }}-x86_64-w64-mingw32.zip osx-x64: runs-on: ubuntu-latest @@ -153,33 +153,12 @@ jobs: - name: Get artifacts uses: actions/download-artifact@v3 - - name: zip package for win-x64 - run: | - set -e; ver=${{ env.BUILD_VERSION }} - cd defichain-${ver}-x86_64-w64-mingw32 - tar xzf defichain-${ver}-x86_64-w64-mingw32.tar.gz - zip -r "defichain-${ver}-x86_64-w64-mingw32.zip" defichain-${ver}/ - - name: Get release id: get_release uses: bruceadams/get-release@v1.3.2 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Generate SHA256 checksum - run: | - set -e; ver=${{ env.BUILD_VERSION }} - (cd ./defichain-${ver}-x86_64-pc-linux-gnu - sha256sum ./defichain-${ver}-x86_64-pc-linux-gnu.tar.gz > ./defichain-${ver}-x86_64-pc-linux-gnu.tar.gz.SHA256) - (cd ./defichain-${ver}-aarch64-linux-gnu - sha256sum ./defichain-${ver}-aarch64-linux-gnu.tar.gz > ./defichain-${ver}-aarch64-linux-gnu.tar.gz.SHA256) - (cd ./defichain-${ver}-x86_64-w64-mingw32 - sha256sum ./defichain-${ver}-x86_64-w64-mingw32.zip > ./defichain-${ver}-x86_64-w64-mingw32.zip.SHA256) - (cd ./defichain-${ver}-x86_64-apple-darwin - sha256sum ./defichain-${ver}-x86_64-apple-darwin.tar.gz > ././defichain-${ver}-x86_64-apple-darwin.tar.gz.SHA256) - (cd ./defichain-${ver}-aarch64-apple-darwin - sha256sum ./defichain-${ver}-aarch64-apple-darwin.tar.gz > ././defichain-${ver}-aarch64-apple-darwin.tar.gz.SHA256) - - name: Upload release asset - linux-x64 uses: actions/upload-release-asset@v1 env: diff --git a/.github/workflows/build-staging.yaml b/.github/workflows/build-staging.yaml index d04e4d3994..9a3e2774f5 100644 --- a/.github/workflows/build-staging.yaml +++ b/.github/workflows/build-staging.yaml @@ -66,7 +66,7 @@ jobs: uses: actions/upload-artifact@v3 with: name: defichain-${{ env.BUILD_VERSION }}-x86_64-w64-mingw32 - path: ./build/defichain-${{ env.BUILD_VERSION }}-x86_64-w64-mingw32.tar.gz + path: ./build/defichain-${{ env.BUILD_VERSION }}-x86_64-w64-mingw32.zip osx-x64: runs-on: ubuntu-latest @@ -132,24 +132,3 @@ jobs: - name: Get artifacts uses: actions/download-artifact@v3 - - - name: zip package for win-x64 - run: | - set -e; ver=${{ env.BUILD_VERSION }} - cd defichain-${ver}-x86_64-w64-mingw32 - tar xzf defichain-${ver}-x86_64-w64-mingw32.tar.gz - zip -r "defichain-${ver}-x86_64-w64-mingw32.zip" defichain-${ver}/ - - - name: Generate SHA256 checksum - run: | - set -e; ver=${{ env.BUILD_VERSION }} - (cd ./defichain-${ver}-x86_64-pc-linux-gnu - sha256sum ./defichain-${ver}-x86_64-pc-linux-gnu.tar.gz > ./defichain-${ver}-x86_64-pc-linux-gnu.tar.gz.SHA256) - (cd ./defichain-${ver}-aarch64-linux-gnu - sha256sum ./defichain-${ver}-aarch64-linux-gnu.tar.gz > ./defichain-${ver}-aarch64-linux-gnu.tar.gz.SHA256) - (cd ./defichain-${ver}-x86_64-w64-mingw32 - sha256sum ./defichain-${ver}-x86_64-w64-mingw32.zip > ./defichain-${ver}-x86_64-w64-mingw32.zip.SHA256) - (cd ./defichain-${ver}-x86_64-apple-darwin - sha256sum ./defichain-${ver}-x86_64-apple-darwin.tar.gz > ././defichain-${ver}-x86_64-apple-darwin.tar.gz.SHA256) - (cd ./defichain-${ver}-aarch64-apple-darwin - sha256sum ./defichain-${ver}-aarch64-apple-darwin.tar.gz > ././defichain-${ver}-aarch64-apple-darwin.tar.gz.SHA256) From 389343fc6998ab1963bbd5648cb14e6bb7e661d9 Mon Sep 17 00:00:00 2001 From: Nitin Goel Date: Tue, 17 Oct 2023 09:56:00 +0530 Subject: [PATCH 4/5] using pkg_type to make packaging genereic --- make.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/make.sh b/make.sh index 8d4b8c4bdb..fdbf933f50 100755 --- a/make.sh +++ b/make.sh @@ -213,6 +213,7 @@ deploy() { package() { local target=${1:-${TARGET}} + local pkg_type=${2:-"tar"} local img_prefix="${IMAGE_PREFIX}" local img_version="${IMAGE_VERSION}" local build_dir="${BUILD_DIR}" @@ -220,7 +221,7 @@ package() { local pkg_name="${img_prefix}-${img_version}-${target}" local pkg_path - if [[ "${TARGET}" == "x86_64-w64-mingw32" ]]; then + if [[ "${pkg_type}" == "zip" ]]; then pkg_path="$(_canonicalize "${build_dir}/"${pkg_name}.zip"")" else pkg_path="$(_canonicalize "${build_dir}/"${pkg_name}.tar.gz"")" @@ -238,7 +239,7 @@ package() { echo "> packaging: ${pkg_name} from ${versioned_build_dir}" - if [[ "${TARGET}" == "x86_64-w64-mingw32" ]]; then + if [[ "${pkg_type}" == "zip" ]]; then _ensure_enter_dir "${build_dir}" zip -r "${pkg_path}" "${versioned_build_dir}/" else @@ -256,7 +257,7 @@ release() { build "${target}" deploy "${target}" - package "${target}" + package "${target}" "${2:-"tar"}" _sign "${target}" } @@ -316,7 +317,7 @@ docker_release() { docker_build "$target" docker_deploy "$target" - package "$target" + package "$target" "${2:-"tar"}" _sign "$target" } From f5596de8574fd93e72a528bd536888c915044c51 Mon Sep 17 00:00:00 2001 From: Nitin Goel Date: Tue, 17 Oct 2023 09:59:52 +0530 Subject: [PATCH 5/5] adding zip parameter in build pipeline --- .github/workflows/build-release.yaml | 2 +- .github/workflows/build-staging.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-release.yaml b/.github/workflows/build-release.yaml index 60a3f69558..d847421ca7 100644 --- a/.github/workflows/build-release.yaml +++ b/.github/workflows/build-release.yaml @@ -81,7 +81,7 @@ jobs: run: ./make.sh ci-export-vars - name: Build and package - run: ./make.sh docker-release + run: ./make.sh docker-release "" zip - name: Publish artifact - x86_64-w64-mingw32 uses: actions/upload-artifact@v3 diff --git a/.github/workflows/build-staging.yaml b/.github/workflows/build-staging.yaml index 9a3e2774f5..11dcae7c34 100644 --- a/.github/workflows/build-staging.yaml +++ b/.github/workflows/build-staging.yaml @@ -60,7 +60,7 @@ jobs: run: ./make.sh ci-export-vars - name: Build and package - run: ./make.sh docker-release + run: ./make.sh docker-release "" zip - name: Publish artifact - x86_64-w64-mingw32 uses: actions/upload-artifact@v3