diff --git a/.github/workflows/dispatch.yml b/.github/workflows/dispatch.yml new file mode 100644 index 000000000..129f4e713 --- /dev/null +++ b/.github/workflows/dispatch.yml @@ -0,0 +1,11 @@ +name: "Workflow Dispatch" + +on: push + +jobs: + call-lint: + uses: ./.github/workflows/lint.yml + + call-test: + needs: call-lint + uses: ./.github/workflows/test.yml diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 2a1ffabd8..cf3936f46 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -1,55 +1,56 @@ name: Lint - -on: [push] +on: workflow_call +defaults: + run: + shell: bash +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true jobs: + sh-euox-pipefail-check: + name: "Lint: Check for 'set -euox pipefail' in shell scripts" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Check that all shell scripts use 'set -euox pipefail' + run: bash .github/scripts/ensure_set_euox_pipefail.sh + # We can't use VALIDATE_GO from super linter because of this issue: # https://github.com/github/super-linter/issues/143 go-lint: - name: Lint Go - runs-on: ubuntu-20.04 + name: "Lint: Golang" + runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/setup-go@v2 + - uses: actions/checkout@v3 - name: golangci-lint uses: golangci/golangci-lint-action@v2 with: - version: v1.43.0 + version: latest args: --timeout 5m0s md-link-check: - name: Check Markdown links + name: "Lint: Check for broken Markdown links" runs-on: ubuntu-latest steps: - - name: Checkout code - uses: actions/checkout@v2 - + - uses: actions/checkout@v3 - name: Check if Markdown links are valid uses: gaurav-nelson/github-action-markdown-link-check@v1 - with: + with: config-file: '.github/linters/mlc_config.json' - folder-path: "." - - sh-euox-pipefail-check: - name: Check for 'set -euox pipefail' in shell scripts - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Check that all shell scripts use 'set -euox pipefail' - run: bash .github/scripts/ensure_set_euox_pipefail.sh + use-quiet-mode: 'yes' + use-verbose-mode: 'yes' super-lint: - name: Run super linter + name: "Lint: Super Linter" runs-on: ubuntu-latest steps: - - name: Checkout code - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: fetch-depth: 0 # Required to fetch version - - - name: Super-Linter + - name: Run Super Linter uses: github/super-linter/slim@v4 env: IGNORE_GITIGNORED_FILES: true @@ -60,7 +61,7 @@ jobs: MULTI_STATUS: true VALIDATE_BASH: true - # VALIDATE_GITHUB_ACTIONS: true + VALIDATE_GITHUB_ACTIONS: true VALIDATE_JSON: true VALIDATE_MARKDOWN: true VALIDATE_OPENAPI: true diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 68682e0e3..2638f7c89 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,107 +3,139 @@ name: Release on: push: tags: - - "v*" + - "v[0-9]+.[0-9]+.[0-9]+" jobs: - - build-binary: - name: Build binary + wait-for-all-previous: + name: Wait for test and lint workflows runs-on: ubuntu-20.04 - outputs: - VERSION: ${{ steps.set-version.outputs.VERSION }} steps: - - name: Set up Go 1.17 - uses: actions/setup-go@v2 + - name: Wait for all jobs finished on workflow Test and Lint + uses: lewagon/wait-on-check-action@v1.0.0 with: - go-version: 1.17 - - - name: Get Go protoc compiler plugins - env: - GOLANG_PROTOBUF_VERSION: 1.3.5 - GOGO_PROTOBUF_VERSION: 1.3.2 - GRPC_GATEWAY_VERSION: 1.14.7 - # Taken from: tendermintdev/sdk-proto-gen:v0.2 - run: | - go get \ - github.com/golang/protobuf/protoc-gen-go@v"$GOLANG_PROTOBUF_VERSION" \ - github.com/gogo/protobuf/protoc-gen-gogo@v"$GOGO_PROTOBUF_VERSION" \ - github.com/gogo/protobuf/protoc-gen-gogofast@v"$GOGO_PROTOBUF_VERSION" \ - github.com/gogo/protobuf/protoc-gen-gogofaster@v"$GOGO_PROTOBUF_VERSION" \ - github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway@v"$GRPC_GATEWAY_VERSION" \ - github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger@v"$GRPC_GATEWAY_VERSION" \ - github.com/regen-network/cosmos-proto/protoc-gen-gocosmos@latest - - - name: Install buf - env: - PREFIX: "/usr/local" - VERSION: "1.0.0-rc8" - run: | - curl -sSL "https://github.com/bufbuild/buf/releases/download/v${VERSION}/buf-$(uname -s)-$(uname -m).tar.gz" | \ - sudo tar -xvzf - -C "${PREFIX}" --strip-components 1 - + ref: ${{ github.sha }} + running-workflow-name: 'Wait for test and lint workflows' + repo-token: ${{ secrets.GITHUB_TOKEN }} + wait-interval: 30 + + # ToDo: Get rid of it while moving test images to volumes + # This duplicating is needed because we have to pass GID and UID params + # while building docker images for tests + build-node-images: + name: Build cheqd-node and cheqd-cli images + runs-on: ubuntu-20.04 + needs: wait-for-all-previous + steps: - uses: actions/checkout@v2 with: fetch-depth: 0 # Required to fetch version - - name: Build - run: | - make proto-gen build + - name: Build cheqd-cli with 'cheqd-noded' as entrypoint + run: docker build --target base -t cheqd-cli -f docker/Dockerfile . + + - name: Build cheqd-node with 'node-start' as entrypoint + run: docker build --target node -t cheqd-node -f docker/Dockerfile . + + - name: Save cheqd-cli + run: docker save -o cheqd-cli-image.tar cheqd-cli - - name: Store artifact + - name: Save cheqd-node + run: docker save -o cheqd-node-image.tar cheqd-node + + - name: Store cheqd-cli artifact + uses: actions/upload-artifact@v2 + with: + name: cheqd-cli-image.tar + path: cheqd-cli-image.tar + + - name: Store cheqd-node artifact uses: actions/upload-artifact@v2 with: + name: cheqd-node-image.tar + path: cheqd-node-image.tar + + pre-release: + name: Pre-release + runs-on: ubuntu-20.04 + environment: Pre-Release + needs: build-node-images + outputs: + RCVERSION: ${{ steps.set-version.outputs.RCVERSION }} + steps: + - name: Get artifact from tests + uses: dawidd6/action-download-artifact@v2 + with: + workflow: test.yml name: cheqd-noded - path: build/cheqd-noded - - name: Set version + - name: Restore binary permissions + run: sudo chmod +x cheqd-noded + + - name: Set RC version id: set-version run: | - VERSION=$(build/cheqd-noded version 2>&1) - echo "::set-output name=VERSION::$VERSION" + VERSION=$(./cheqd-noded version 2>&1) + echo "::set-output name=RCVERSION::$VERSION-rc" - build-tar-package: - name: Build tar package + push-rc-images: + name: Push RC images runs-on: ubuntu-20.04 - needs: build-binary + needs: pre-release env: - VERSION: ${{ needs.build-binary.outputs.VERSION }} + RCVERSION: ${{ needs.pre-release.outputs.RCVERSION }} + REGISTRY: ghcr.io steps: - - uses: actions/checkout@v2 + - name: Get cheqd-cli image from tests + uses: actions/download-artifact@v2 + with: + name: cheqd-cli-image.tar - - name: Load binary artifact + - name: Get cheqd-node image from tests uses: actions/download-artifact@v2 with: - name: cheqd-noded + name: cheqd-node-image.tar - - name: Restore binary permissions - run: sudo chmod +x cheqd-noded + - name: Load cli image + run: docker load -i cheqd-cli-image.tar - - name: Build tar - working-directory: ./build-tools - run: | - ./build-tar.sh "../cheqd-noded" + - name: Load node image + run: docker load -i cheqd-node-image.tar - - name: Store tar package artifact - uses: actions/upload-artifact@v2 + - name: Log in to the Container registry + uses: docker/login-action@v1 with: - name: cheqd-node_${{ env.VERSION }}.tar.gz - path: build-tools/output/cheqd-node_${{ env.VERSION }}.tar.gz + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Push cheqd-node image + run: | + docker tag cheqd-node ghcr.io/${{ github.repository }}:${{ env.RCVERSION }} + docker push ghcr.io/${{ github.repository }}:${{ env.RCVERSION }} + docker tag cheqd-node ghcr.io/${{ github.repository }}:latest + docker push ghcr.io/${{ github.repository }}:latest - build-deb-package: - name: Build Debian package + - name: Push cheqd-cli image + run: | + docker tag cheqd-cli ghcr.io/${{ github.repository_owner }}/cheqd-cli:${{ env.RCVERSION }} + docker push ghcr.io/${{ github.repository_owner }}/cheqd-cli:${{ env.RCVERSION }} + docker tag cheqd-cli ghcr.io/${{ github.repository_owner }}/cheqd-cli:latest + docker push ghcr.io/${{ github.repository_owner }}/cheqd-cli:latest + + push-rc-debs: + name: Push RC packages runs-on: ubuntu-20.04 - needs: [ build-binary ] + needs: pre-release env: - VERSION: ${{ needs.build-binary.outputs.VERSION }} + RCVERSION: ${{ needs.pre-release.outputs.RCVERSION }} steps: - uses: actions/checkout@v2 - - name: Load binary artifact - uses: actions/download-artifact@v2 + - name: Get artifact from tests + uses: dawidd6/action-download-artifact@v2 with: + workflow: test.yml name: cheqd-noded - - name: Restore binary permissions run: sudo chmod +x cheqd-noded @@ -112,75 +144,121 @@ jobs: sudo apt-get install ruby ruby-dev rubygems build-essential sudo gem install --no-document fpm - - name: Build deb + - name: Build RC deb working-directory: ./build-tools run: | - ./build-deb.sh "../cheqd-noded" + ./build-deb.sh "../cheqd-noded" "${{ env.RCVERSION }}" - - name: Store Debian package artifact + - name: Store RC deb package artifact uses: actions/upload-artifact@v2 with: - name: cheqd-node_${{ env.VERSION }}_amd64.deb - path: build-tools/output/cheqd-node_${{ env.VERSION }}_amd64.deb + name: cheqd-node_${{ env.RCVERSION }}_amd64.deb + path: build-tools/output/cheqd-node_${{ env.RCVERSION }}_amd64.deb - build-node-images: - name: Build cheqd-node and cheqd-cli images + - name: Build tar + working-directory: ./build-tools + run: | + ./build-tar.sh "../cheqd-noded" "${{ env.RCVERSION }}" + + - uses: "marvinpinto/action-automatic-releases@latest" + with: + repo_token: "${{ secrets.GITHUB_TOKEN }}" + automatic_release_tag: "${{ env.GITHUB_REF_NAME }}" + prerelease: true + draft: true + title: "v${{ env.RCVERSION }}" + files: | + build-tools/output/cheqd-node_${{ env.RCVERSION }}_amd64.deb + build-tools/output/cheqd-node_${{ env.RCVERSION }}.tar.gz + + release: + name: Release runs-on: ubuntu-20.04 + environment: Release + needs: [ push-rc-debs, push-rc-images] + outputs: + VERSION: ${{ steps.set-version.outputs.VERSION }} + steps: + - name: Get artifact from tests + uses: dawidd6/action-download-artifact@v2 + with: + workflow: test.yml + name: cheqd-noded + + - name: Restore binary permissions + run: sudo chmod +x cheqd-noded + + - name: Set release version + id: set-version + run: | + VERSION=$(./cheqd-noded version 2>&1) + echo "::set-output name=VERSION::$VERSION" + + push-release-debs: + name: Push release packages + runs-on: ubuntu-20.04 + needs: release + env: + VERSION: ${{ needs.release.outputs.VERSION }} steps: - uses: actions/checkout@v2 + + - name: Get artifact from tests + uses: dawidd6/action-download-artifact@v2 with: - fetch-depth: 0 # Required to fetch version + workflow: test.yml + name: cheqd-noded - - name: Build cheqd-cli with 'cheqd-noded' as entrypoint - run: docker build --target base -t cheqd-cli -f docker/Dockerfile . + - name: Restore binary permissions + run: sudo chmod +x cheqd-noded - - name: Build cheqd-node with 'node-start' as entrypoint - run: docker build --target node -t cheqd-node -f docker/Dockerfile . + - name: Install fpm + run: | + sudo apt-get install ruby ruby-dev rubygems build-essential + sudo gem install --no-document fpm - - name: Save cheqd-cli - run: docker save -o cheqd-cli-image.tar cheqd-cli + - name: Build release deb + working-directory: ./build-tools + run: | + ./build-deb.sh "../cheqd-noded" - - name: Save cheqd-node - run: docker save -o cheqd-node-image.tar cheqd-node + - name: Build tar + working-directory: ./build-tools + run: | + ./build-tar.sh "../cheqd-noded" - - name: Store cheqd-cli artifact - uses: actions/upload-artifact@v2 - with: - name: cheqd-cli-image.tar - path: cheqd-cli-image.tar - - - name: Store cheqd-node artifact - uses: actions/upload-artifact@v2 + - uses: "marvinpinto/action-automatic-releases@latest" with: - name: cheqd-node-image.tar - path: cheqd-node-image.tar + repo_token: "${{ secrets.GITHUB_TOKEN }}" + automatic_release_tag: "${{ env.GITHUB_REF_NAME }}" + prerelease: true + title: "v${{ env.VERSION }}" + files: | + build-tools/output/cheqd-node_${{ env.VERSION }}_amd64.deb + build-tools/output/cheqd-node_${{ env.VERSION }}.tar.gz - publish: - name: "Publish images and release" - # Reference to workflow-setup job is required to access its various outputs. - needs: [ build-binary, build-node-images, build-deb-package, build-tar-package ] - runs-on: ubuntu-latest + push-release-images: + name: Push release images + runs-on: ubuntu-20.04 + needs: release env: - VERSION: ${{ needs.build-binary.outputs.VERSION }} + VERSION: ${{ needs.release.outputs.VERSION }} REGISTRY: ghcr.io steps: - - name: Git checkout - uses: actions/checkout@v2 - - - name: Download cheqd-cli image + - name: Get cheqd-cli image from tests uses: actions/download-artifact@v2 with: name: cheqd-cli-image.tar - - name: Download cheqd-node image + - name: Get cheqd-node image from tests uses: actions/download-artifact@v2 with: name: cheqd-node-image.tar - - name: Load cheqd-cli image + - name: Load cli image run: docker load -i cheqd-cli-image.tar - - name: Load cheqd-node image + - name: Load node image run: docker load -i cheqd-node-image.tar - name: Log in to the Container registry @@ -193,32 +271,13 @@ jobs: - name: Push cheqd-node image run: | docker tag cheqd-node ghcr.io/${{ github.repository }}:${{ env.VERSION }} - docker tag cheqd-node ghcr.io/${{ github.repository }}:latest docker push ghcr.io/${{ github.repository }}:${{ env.VERSION }} + docker tag cheqd-node ghcr.io/${{ github.repository }}:latest docker push ghcr.io/${{ github.repository }}:latest - name: Push cheqd-cli image run: | docker tag cheqd-cli ghcr.io/${{ github.repository_owner }}/cheqd-cli:${{ env.VERSION }} - docker tag cheqd-cli ghcr.io/${{ github.repository_owner }}/cheqd-cli:latest docker push ghcr.io/${{ github.repository_owner }}/cheqd-cli:${{ env.VERSION }} + docker tag cheqd-cli ghcr.io/${{ github.repository_owner }}/cheqd-cli:latest docker push ghcr.io/${{ github.repository_owner }}/cheqd-cli:latest - - - name: Download deb - uses: actions/download-artifact@v2 - with: - name: cheqd-node_${{ env.VERSION }}_amd64.deb - - - name: Download tar - uses: actions/download-artifact@v2 - with: - name: cheqd-node_${{ env.VERSION }}.tar.gz - - - uses: "marvinpinto/action-automatic-releases@latest" - with: - repo_token: "${{ secrets.GITHUB_TOKEN }}" - automatic_release_tag: "${{ env.GITHUB_REF_NAME }}" - prerelease: true - files: | - cheqd-node_${{ env.VERSION }}_amd64.deb - cheqd-node_${{ env.VERSION }}.tar.gz diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ce26a1031..ecd1b4f8d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,7 +1,7 @@ name: "Build and Test" on: - push: + workflow_call: paths-ignore: - '**.md' - 'docs/**' @@ -12,9 +12,11 @@ env: NODE_CONFIGS_BASE: "/home/runner/work/cheqd-node/cheqd-node/docker/localnet/network-config" jobs: + run-unit-test: name: Run unit tests runs-on: ubuntu-20.04 + needs: wait-for-lint steps: - name: Set up Go 1.17 uses: actions/setup-go@v2 @@ -27,8 +29,9 @@ jobs: run: go test -v ./... build-binary: - name: Build binary + name: "Build: binary" runs-on: ubuntu-20.04 + needs: wait-for-lint outputs: VERSION: ${{ steps.set-version.outputs.VERSION }} steps: @@ -82,7 +85,7 @@ jobs: echo "::set-output name=VERSION::$VERSION" build-tar-package: - name: Build tar package + name: "Build: tar package" runs-on: ubuntu-20.04 needs: build-binary env: @@ -110,7 +113,7 @@ jobs: path: build-tools/output/cheqd-node_${{ env.VERSION }}.tar.gz build-deb-package: - name: Build deb package + name: "Build: deb package" runs-on: ubuntu-20.04 needs: build-binary env: @@ -143,8 +146,9 @@ jobs: path: build-tools/output/cheqd-node_${{ env.VERSION }}_amd64.deb build-node-images: - name: Build cheqd-node and cheqd-cli images + name: "Build: cheqd-node and cheqd-cli images" runs-on: ubuntu-20.04 + needs: wait-for-lint steps: - uses: actions/checkout@v2 with: @@ -152,7 +156,7 @@ jobs: - name: Build cheqd-cli with 'cheqd-noded' as entrypoint # TODO: Get rid of UID and GID - run: docker build --target base -t cheqd-cli -f docker/Dockerfile --build-arg UID="$(id -u)" --build-arg GID="$(id -g)" . + run: docker build --target base -t cheqd-cli -f docker/Dockerfile --build-arg UID="$(id -u)" --build-arg GID="$(id -g)" . - name: Build cheqd-node with 'node-start' as entrypoint run: docker build --target node -t cheqd-node -f docker/Dockerfile --build-arg UID="$(id -u)" --build-arg GID="$(id -g)" . @@ -163,20 +167,20 @@ jobs: - name: Save cheqd-node run: docker save -o cheqd-node-image.tar cheqd-node - - name: Store cheqd-cli artifact + - name: Store cheqd-cli artifact uses: actions/upload-artifact@v2 with: name: cheqd-cli-image.tar path: cheqd-cli-image.tar - - - name: Store cheqd-node artifact + + - name: Store cheqd-node artifact uses: actions/upload-artifact@v2 with: name: cheqd-node-image.tar path: cheqd-node-image.tar test-new-node-setup-from-deb: - name: Test new node setup from deb + name: "Test: New node setup from deb" runs-on: ubuntu-20.04 needs: [build-binary, build-deb-package, build-node-images] env: @@ -222,7 +226,9 @@ jobs: run: | ./promote-validator.sh cheqd-noded query staking validators --node "http://localhost:26657" | sed -nr 's/.*status: (.*?).*/\1/p' "$1" | while read -r x; do [[ "BOND_STATUS_BONDED" == "$x" ]] && echo "Validator's status is bonded!" || exit 1 ; done + # shellcheck disable=SC2016 ./wait.sh '[[ $(curl -s localhost:26657/block | sed -nr '"'"'s/.*signature": (.*?).*/\1/p'"'"' | wc -l) == 5 ]] && echo "There are 5 validators signatures in block!"' + # shellcheck disable=SC2016 ./wait.sh '[[ $(curl -s localhost:26657/block | sed -nr '"'"'s/.*(signature": null).*/\1/p'"'"' | wc -l) == 0 ]] && echo "There are no null signatures in block!"' - name: Gather logs on failure @@ -231,7 +237,7 @@ jobs: journalctl -ex | grep cheqd run-python-based-integration-tests: - name: Run python based cosmos and identity tests + name: "Test: Run python based cosmos and identity tests" runs-on: ubuntu-20.04 needs: [build-node-images, build-binary] steps: @@ -292,7 +298,7 @@ jobs: pytest -v -rP test_identity.py run-bash-based-integration-tests: - name: Run bash based identity tests + name: "Test: Run bash based identity tests" runs-on: ubuntu-20.04 needs: [build-binary, build-node-images] steps: @@ -336,7 +342,7 @@ jobs: bash run_all.sh run-upgrade-test-positive-case: - name: Run positive case for upgrade + name: "Test: Run positive case for upgrade" runs-on: ubuntu-20.04 needs: build-node-images steps: diff --git a/README.md b/README.md index bd4f007b0..a294a09fd 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ # cheqd: Node Documentation -[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/cheqd/cheqd-node/Test/main?style=flat-square)](https://github.com/cheqd/cheqd-node/actions/workflows/test.yml) [![GitHub Super-Linter](https://github.com/cheqd/cheqd-node/workflows/Lint/badge.svg?style=flat-square)](https://github.com/cheqd/cheqd-node/actions/workflows/lint.yml) +[![GitHub Workflow Status (branch)](https://img.shields.io/github/workflow/status/cheqd/cheqd-node/Build%20and%20Test/main?style=flat-square)](https://github.com/cheqd/cheqd-node/actions/workflows/test.yml) [![GitHub Workflow Status (branch)](https://img.shields.io/github/workflow/status/cheqd/cheqd-node/Lint/main?label=lint&style=flat-square)](https://github.com/cheqd/cheqd-node/actions/workflows/lint.yml) -[![GitHub release (latest by date)](https://img.shields.io/github/v/release/cheqd/cheqd-node?color=green&label=stable+version&style=flat-square)](https://github.com/cheqd/cheqd-node/releases/latest) ![GitHub Release Date](https://img.shields.io/github/release-date/cheqd/cheqd-node?style=flat-square) +[![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/cheqd/cheqd-node?color=green&label=stable&sort=semver&style=flat-square)](https://github.com/cheqd/cheqd-node/releases/latest) ![GitHub Release Date](https://img.shields.io/github/release-date/cheqd/cheqd-node?style=flat-square) -[![GitHub release (latest by date including pre-releases)](https://img.shields.io/github/v/release/cheqd/cheqd-node?include_prereleases&label=pre-release&style=flat-square)](https://github.com/cheqd/cheqd-node/releases/) ![GitHub commits since latest release (by date)](https://img.shields.io/github/commits-since/cheqd/cheqd-node/latest?style=flat-square) +[![GitHub release (latest SemVer including pre-releases)](https://img.shields.io/github/v/release/cheqd/cheqd-node?include_prereleases&label=latest%20%28incl.%20pre-release%29&sort=semver&style=flat-square)](https://github.com/cheqd/cheqd-node/releases/) ![GitHub commits since latest release (by date)](https://img.shields.io/github/commits-since/cheqd/cheqd-node/latest?style=flat-square) [![GitHub contributors](https://img.shields.io/github/contributors/cheqd/cheqd-node?style=flat-square)](https://github.com/cheqd/cheqd-node/graphs/contributors) ![GitHub repo size](https://img.shields.io/github/repo-size/cheqd/cheqd-node?style=flat-square) diff --git a/build-tools/build-deb.sh b/build-tools/build-deb.sh index 8c263f7c6..4cc055599 100755 --- a/build-tools/build-deb.sh +++ b/build-tools/build-deb.sh @@ -7,7 +7,14 @@ if [ -z ${1+x} ]; then fi BINARY_PATH="$1" -VERSION=$("${BINARY_PATH}" version 2>&1) +# It's needed for creating an RC deb package +if [ -z ${2+x} ]; +then + VERSION=$("${BINARY_PATH}" version 2>&1) +else + VERSION="$2" +fi + PKG_NAME="cheqd-node" BUILD_DIR="build" diff --git a/build-tools/build-tar.sh b/build-tools/build-tar.sh index fc5462f38..e183dcb9e 100755 --- a/build-tools/build-tar.sh +++ b/build-tools/build-tar.sh @@ -7,7 +7,14 @@ if [ -z ${1+x} ]; then fi BINARY_PATH="$1" -VERSION=$("${BINARY_PATH}" version 2>&1) +# It's needed for creating an RC deb package +if [ -z ${2+x} ]; +then + VERSION=$("${BINARY_PATH}" version 2>&1) +else + VERSION="$2" +fi + PKG_NAME="cheqd-node" BUILD_DIR="build"