diff --git a/.github/workflows/beta_artifacts.yml b/.github/workflows/beta_artifacts.yml index d29800a1..d3371e3b 100644 --- a/.github/workflows/beta_artifacts.yml +++ b/.github/workflows/beta_artifacts.yml @@ -32,7 +32,7 @@ jobs: - name: Fetch Deps run: ci/actions/osx/install_deps.sh - name: Build Artifact - run: TRAVIS_TAG=${TAG} ci/build-deploy.sh "/tmp/qt/lib/cmake/Qt5"; + run: CI_TAG=${TAG} ci/build-deploy.sh "/tmp/qt/lib/cmake/Qt5"; - name: Deploy Artifact run: ci/actions/deploy.sh env: @@ -58,7 +58,7 @@ jobs: COMPILER: gcc run: ci/actions/linux/install_deps.sh - name: Build Artifact - run: docker run -v ${GITHUB_WORKSPACE}:/workspace nanocurrency/nano-env:gcc /bin/bash -c "cd /workspace && BETA=1 TRAVIS_TAG=${TAG} ci/build-deploy.sh /usr/lib/x86_64-linux-gnu/cmake/Qt5" + run: docker run -v ${GITHUB_WORKSPACE}:/workspace nanocurrency/nano-env:gcc /bin/bash -c "cd /workspace && BETA=1 CI_TAG=${TAG} ci/build-deploy.sh /usr/lib/x86_64-linux-gnu/cmake/Qt5" - name: Deploy Artifact run: ci/actions/deploy.sh env: @@ -84,10 +84,10 @@ jobs: COMPILER: gcc run: ci/actions/linux/install_deps.sh - name: Build Docker (nanocurrency/nano-beta) - run: TRAVIS_TAG=${TAG} ci/actions/linux/docker-build.sh + run: CI_TAG=${TAG} ci/actions/linux/docker-build.sh - name: Deploy Docker Hub (nanocurrency/nano-beta) if: ${{ github.repository == 'nanocurrency/nano-node' }} - run: TRAVIS_TAG=${TAG} ci/actions/linux/docker-deploy.sh + run: CI_TAG=${TAG} ci/actions/linux/docker-deploy.sh env: DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} - name: Login to ghcr.io diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index b0a9f5f3..3b375d07 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -40,7 +40,7 @@ jobs: - name: Build and Test env: TEST_USE_ROCKSDB: ${{ matrix.TEST_USE_ROCKSDB }} - run: ./ci/build-travis.sh /usr/lib/x86_64-linux=gnu/cmake/Qt5 + run: ./ci/build-ci.sh /usr/lib/x86_64-linux=gnu/cmake/Qt5 - uses: coverallsapp/github-action@8cbef1dea373ebce56de0a14c68d6267baa10b44 with: github-token: ${{ secrets.github_token }} diff --git a/.github/workflows/live_artifacts.yml b/.github/workflows/live_artifacts.yml index f797b893..9fce1f1d 100644 --- a/.github/workflows/live_artifacts.yml +++ b/.github/workflows/live_artifacts.yml @@ -31,7 +31,7 @@ jobs: - name: Fetch Deps run: ci/actions/osx/install_deps.sh - name: Build Artifact - run: TRAVIS_TAG=${TAG} ci/build-deploy.sh "/tmp/qt/lib/cmake/Qt5"; + run: CI_TAG=${TAG} ci/build-deploy.sh "/tmp/qt/lib/cmake/Qt5"; - name: Deploy Artifact run: ci/actions/deploy.sh env: @@ -57,7 +57,7 @@ jobs: COMPILER: gcc run: ci/actions/linux/install_deps.sh - name: Build Artifact - run: docker run -v ${GITHUB_WORKSPACE}:/workspace nanocurrency/nano-env:gcc /bin/bash -c "cd /workspace && TRAVIS_TAG=${TAG} ci/build-deploy.sh /usr/lib/x86_64-linux-gnu/cmake/Qt5" + run: docker run -v ${GITHUB_WORKSPACE}:/workspace nanocurrency/nano-env:gcc /bin/bash -c "cd /workspace && CI_TAG=${TAG} ci/build-deploy.sh /usr/lib/x86_64-linux-gnu/cmake/Qt5" - name: Deploy Artifact run: ci/actions/deploy.sh env: @@ -114,10 +114,10 @@ jobs: COMPILER: gcc run: ci/actions/linux/install_deps.sh - name: Build Docker (nanocurrency/nano) - run: TRAVIS_TAG=${TAG} ci/actions/linux/docker-build.sh + run: CI_TAG=${TAG} ci/actions/linux/docker-build.sh - name: Deploy Docker Hub (nanocurrency/nano) if: ${{ github.repository == 'nanocurrency/nano-node' }} - run: TRAVIS_TAG=${TAG} ci/actions/linux/docker-deploy.sh + run: CI_TAG=${TAG} ci/actions/linux/docker-deploy.sh env: DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} - name: Login to ghcr.io diff --git a/.github/workflows/test_network_artifacts.yml b/.github/workflows/test_network_artifacts.yml index cd79847d..c84edff7 100644 --- a/.github/workflows/test_network_artifacts.yml +++ b/.github/workflows/test_network_artifacts.yml @@ -32,7 +32,7 @@ jobs: - name: Fetch Deps run: ci/actions/osx/install_deps.sh - name: Build Artifact - run: TRAVIS_TAG=${TAG} ci/build-deploy.sh "/tmp/qt/lib/cmake/Qt5"; + run: CI_TAG=${TAG} ci/build-deploy.sh "/tmp/qt/lib/cmake/Qt5"; - name: Deploy Artifact run: ci/actions/deploy.sh env: @@ -58,7 +58,7 @@ jobs: COMPILER: gcc run: ci/actions/linux/install_deps.sh - name: Build Artifact - run: docker run -e TEST -v ${GITHUB_WORKSPACE}:/workspace nanocurrency/nano-env:gcc /bin/bash -c "cd /workspace && TRAVIS_TAG=${TAG} ci/build-deploy.sh /usr/lib/x86_64-linux-gnu/cmake/Qt5" + run: docker run -e TEST -v ${GITHUB_WORKSPACE}:/workspace nanocurrency/nano-env:gcc /bin/bash -c "cd /workspace && CI_TAG=${TAG} ci/build-deploy.sh /usr/lib/x86_64-linux-gnu/cmake/Qt5" - name: Deploy Artifact run: ci/actions/deploy.sh env: @@ -84,10 +84,10 @@ jobs: COMPILER: gcc run: ci/actions/linux/install_deps.sh - name: Build Docker (nanocurrency/nano) - run: TRAVIS_TAG=${TAG} ci/actions/linux/docker-build.sh + run: CI_TAG=${TAG} ci/actions/linux/docker-build.sh - name: Deploy Docker Hub (nanocurrency/nano-test) if: ${{ github.repository == 'nanocurrency/nano-node' }} - run: TRAVIS_TAG=${TAG} ci/actions/linux/docker-deploy.sh + run: CI_TAG=${TAG} ci/actions/linux/docker-deploy.sh env: DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} - name: Login to ghcr.io diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b0902cc1..e80d3d4d 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -28,7 +28,7 @@ jobs: - name: Fetch Deps run: TEST=1 ci/actions/osx/install_deps.sh - name: Build Tests - run: ci/build-travis.sh "/tmp/qt/lib/cmake/Qt5"; + run: ci/build-ci.sh "/tmp/qt/lib/cmake/Qt5"; - name: Run Tests lmdb if: ${{ matrix.TEST_USE_ROCKSDB == 0 }} run: cd build && sudo TEST_USE_ROCKSDB=$TEST_USE_ROCKSDB ../ci/test.sh . @@ -61,7 +61,7 @@ jobs: - name: Fetch Deps run: ci/actions/linux/install_deps.sh - name: Build Tests - run: docker run -e TEST_USE_ROCKSDB -e RELEASE -v ${PWD}:/workspace nanocurrency/nano-env:${{ matrix.COMPILER }} /bin/bash -c "cd /workspace && ./ci/build-travis.sh /usr/lib/x86_64-linux-gnu/cmake/Qt5" + run: docker run -e TEST_USE_ROCKSDB -e RELEASE -v ${PWD}:/workspace nanocurrency/nano-env:${{ matrix.COMPILER }} /bin/bash -c "cd /workspace && ./ci/build-ci.sh /usr/lib/x86_64-linux-gnu/cmake/Qt5" - name: Run Tests lmdb if: ${{ matrix.TEST_USE_ROCKSDB == 0 }} run: docker run -e RELEASE -v ${PWD}:/workspace nanocurrency/nano-env:${{ matrix.COMPILER }} /bin/bash -c "cd /workspace/build && ../ci/test.sh ." diff --git a/CMakeLists.txt b/CMakeLists.txt index 0af358dd..cff90468 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -53,7 +53,7 @@ set(CPACK_PACKAGE_VERSION_PRE_RELEASE "99") set(CPACK_PACKAGE_VENDOR "Nano Currency") if(CI_BUILD) - set(TAG_VERSION_STRING "$ENV{TRAVIS_TAG}") + set(TAG_VERSION_STRING "$ENV{CI_TAG}") else() set(TAG_VERSION_STRING "V${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}") diff --git a/ci/actions/linux/docker-impl/docker-common.sh b/ci/actions/linux/docker-impl/docker-common.sh index 0be32930..6a32bc55 100755 --- a/ci/actions/linux/docker-impl/docker-common.sh +++ b/ci/actions/linux/docker-impl/docker-common.sh @@ -4,13 +4,13 @@ set -e set -a scripts="$PWD/ci" -TRAVIS_BRANCH=$(git branch | cut -f2 -d' ') +CI_BRANCH=$(git branch | cut -f2 -d' ') tags=() -if [ -n "$TRAVIS_TAG" ]; then - tags+=("$TRAVIS_TAG") -elif [ -n "$TRAVIS_BRANCH" ]; then - TRAVIS_TAG=$TRAVIS_BRANCH - tags+=("$TRAVIS_BRANCH") +if [ -n "$CI_TAG" ]; then + tags+=("$CI_TAG") +elif [ -n "$CI_BRANCH" ]; then + CI_TAG=$CI_BRANCH + tags+=("$CI_BRANCH") fi if [[ "$GITHUB_WORKFLOW" = "Live" ]]; then echo "Live" @@ -34,7 +34,7 @@ docker_build() { if [[ "$GITHUB_WORKFLOW" != "Develop" ]]; then ghcr_image_name="ghcr.io/${GITHUB_REPOSITORY}/nano${network_tag_suffix}" - "$scripts"/build-docker-image.sh docker/node/Dockerfile "$docker_image_name" --build-arg NETWORK="$network" --build-arg CI_BUILD=true --build-arg TRAVIS_TAG="$TRAVIS_TAG" + "$scripts"/build-docker-image.sh docker/node/Dockerfile "$docker_image_name" --build-arg NETWORK="$network" --build-arg CI_BUILD=true --build-arg CI_TAG="$CI_TAG" for tag in "${tags[@]}"; do # Sanitize docker tag # https://docs.docker.com/engine/reference/commandline/tag/ diff --git a/ci/actions/windows/build.ps1 b/ci/actions/windows/build.ps1 index 50010741..44d86c13 100644 --- a/ci/actions/windows/build.ps1 +++ b/ci/actions/windows/build.ps1 @@ -14,7 +14,7 @@ if (${env:artifact} -eq 1) { } $env:NANO_SHARED_BOOST = "ON" $env:NANO_TEST = "-DNANO_TEST=OFF" - $env:TRAVIS_TAG = ${env:TAG} + $env:CI_TAG = ${env:TAG} $env:CI = "-DCI_BUILD=ON" $env:RUN = "artifact" diff --git a/ci/build-travis.sh b/ci/build-ci.sh similarity index 100% rename from ci/build-travis.sh rename to ci/build-ci.sh diff --git a/ci/deploy-docker.sh b/ci/deploy-docker.sh deleted file mode 100755 index fc2fd085..00000000 --- a/ci/deploy-docker.sh +++ /dev/null @@ -1,54 +0,0 @@ -#!/bin/bash -set -e - -scripts="$(dirname "$0")" - -if [ -n "$DOCKER_PASSWORD" ]; then - echo "$DOCKER_PASSWORD" | docker login -u nanoreleaseteam --password-stdin - - # We push this just so it can be a cache next time - if [[ "$TRAVIS_BRANCH" == "master" || "$TRAVIS_BRANCH" == "docker_cache" ]] && [[ "${TRAVIS_BUILD_STAGE_NAME}" =~ 'Build' ]]; then - ci_image_name="nanocurrency/nano-env:$TRAVIS_JOB_NAME" - ci/build-docker-image.sh docker/ci/Dockerfile-$TRAVIS_JOB_NAME "$ci_image_name" - "$scripts"/custom-timeout.sh 30 docker push "$ci_image_name" - fi - - if [[ "$TRAVIS_BUILD_STAGE_NAME" == "Master_beta_docker" ]]; then - # quick build and tag beta network master - "$scripts"/custom-timeout.sh 30 docker build --build-arg NETWORK=beta --build-arg CI_BUILD=true --build-arg TRAVIS_TAG="$TRAVIS_TAG" -f docker/node/Dockerfile -t nanocurrency/nano-beta:master --cache-from nanocurrency/nano-beta:master . - "$scripts"/custom-timeout.sh 30 docker push nanocurrency/nano-beta:master - elif [[ "$TRAVIS_BUILD_STAGE_NAME" =~ "Artifacts" ]]; then - tags=() - if [[ "${TRAVIS_TAG}" =~ ("RC"|"DB") ]]; then - tags+=("$TRAVIS_TAG" latest latest-including-rc) - elif [ -n "$TRAVIS_TAG" ]; then - tags+=("$TRAVIS_TAG" latest latest-including-rc) - elif [ -n "$TRAVIS_BRANCH" ]; then - tags+=("$TRAVIS_BRANCH") - fi - - if [[ "$TRAVIS_JOB_NAME" =~ "live" ]]; then - network_tag_suffix='' - network="live" - cached='' - else - network_tag_suffix="-beta" - network="beta" - # use cache from Master_beta_docker to prevent rebuilds - cached="--cache-from=nanocurrency/nano-beta:master" - docker pull nanocurrency/nano-beta:master - fi - - docker_image_name="nanocurrency/nano${network_tag_suffix}" - "$scripts"/custom-timeout.sh 30 docker build "$cached" --build-arg NETWORK="$network" --build-arg CI_BUILD=true --build-arg TRAVIS_TAG="$TRAVIS_TAG" -f docker/node/Dockerfile -t "$docker_image_name" . - for tag in "${tags[@]}"; do - # Sanitize docker tag - # https://docs.docker.com/engine/reference/commandline/tag/ - tag="$(printf '%s' "$tag" | tr -c '[a-z][A-Z][0-9]_.-' -)" - if [ "$tag" != "latest" ]; then - docker tag "$docker_image_name" "${docker_image_name}:$tag" - fi - "$scripts"/custom-timeout.sh 30 docker push "${docker_image_name}:$tag" - done - fi -fi diff --git a/ci/deploy-travis.sh b/ci/deploy-travis.sh deleted file mode 100755 index 4a24eae9..00000000 --- a/ci/deploy-travis.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash - -set -o errexit -set -o nounset -set -o xtrace -OS=$(uname) - -if [[ "${BETA-0}" -eq 1 ]]; then - BUILD="beta" -else - BUILD="live" -fi - -if [[ "$OS" == 'Linux' ]]; then - aws s3 cp $TRAVIS_BUILD_DIR/build/nano-node-*-Linux.tar.bz2 s3://$AWS_BUCKET/$BUILD/binaries/nano-node-$TRAVIS_TAG-Linux.tar.bz2 --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers -else - aws s3 cp $TRAVIS_BUILD_DIR/build/nano-node-*-Darwin.dmg s3://$AWS_BUCKET/$BUILD/binaries/nano-node-$TRAVIS_TAG-Darwin.dmg --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers -fi diff --git a/docker/node/Dockerfile b/docker/node/Dockerfile index 1f7d7b14..825364cb 100644 --- a/docker/node/Dockerfile +++ b/docker/node/Dockerfile @@ -1,7 +1,7 @@ FROM nanocurrency/nano-env:gcc ARG NETWORK=live -ARG TRAVIS_TAG=DEV_BUILD +ARG CI_TAG=DEV_BUILD ARG CI_BUILD=OFF ADD ./ /tmp/src