Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUILD: Move shasum and windows specific in make.sh #2586

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 2 additions & 23 deletions .github/workflows/build-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,13 @@ 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
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
Expand Down Expand Up @@ -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/[email protected]
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:
Expand Down
25 changes: 2 additions & 23 deletions .github/workflows/build-staging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,13 @@ 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
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
Expand Down Expand Up @@ -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)
25 changes: 18 additions & 7 deletions make.sh
Original file line number Diff line number Diff line change
Expand Up @@ -213,15 +213,19 @@ 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}"

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 [[ "${pkg_type}" == "zip" ]]; 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}"
Expand All @@ -234,8 +238,15 @@ package() {

echo "> packaging: ${pkg_name} from ${versioned_build_dir}"

_ensure_enter_dir "${versioned_build_dir}"
_tar --transform "s,^./,${versioned_name}/," -czf "${pkg_path}" ./*

if [[ "${pkg_type}" == "zip" ]]; 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

echo "> package: ${pkg_path}"
Expand All @@ -246,7 +257,7 @@ release() {

build "${target}"
deploy "${target}"
package "${target}"
package "${target}" "${2:-"tar"}"
_sign "${target}"
}

Expand Down Expand Up @@ -306,7 +317,7 @@ docker_release() {

docker_build "$target"
docker_deploy "$target"
package "$target"
package "$target" "${2:-"tar"}"
_sign "$target"
}

Expand Down Expand Up @@ -1165,7 +1176,7 @@ get_rust_triplet() {
}

_sign() {
# TODO: generate sha sums and sign
# TODO: sign
:
}

Expand Down
Loading