From bc984e0cb1d6ad63fc3ff536fb5875592863bdc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Soko=C5=82owski?= Date: Tue, 20 Aug 2024 09:38:38 +0200 Subject: [PATCH] chore(ci)_: fix formatting, bump library version MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Also drop unused `_assets/ci/validate-vendor.sh` script. Signed-off-by: Jakub SokoĊ‚owski --- _assets/ci/Jenkinsfile | 2 +- _assets/ci/Jenkinsfile.android | 10 ++++-- _assets/ci/Jenkinsfile.docker | 2 +- _assets/ci/Jenkinsfile.ios | 13 ++++--- _assets/ci/Jenkinsfile.linux | 10 ++++-- _assets/ci/Jenkinsfile.tests | 2 +- _assets/ci/Jenkinsfile.tests-rpc | 13 ++++--- _assets/ci/validate-vendor.sh | 62 -------------------------------- 8 files changed, 36 insertions(+), 78 deletions(-) delete mode 100755 _assets/ci/validate-vendor.sh diff --git a/_assets/ci/Jenkinsfile b/_assets/ci/Jenkinsfile index 68bc18743..ed66572c3 100644 --- a/_assets/ci/Jenkinsfile +++ b/_assets/ci/Jenkinsfile @@ -1,5 +1,5 @@ #!/usr/bin/env groovy -library 'status-jenkins-lib@v1.8.10' +library 'status-jenkins-lib@v1.9.6' pipeline { agent { label 'linux' } diff --git a/_assets/ci/Jenkinsfile.android b/_assets/ci/Jenkinsfile.android index 6e06b551a..9c359853e 100644 --- a/_assets/ci/Jenkinsfile.android +++ b/_assets/ci/Jenkinsfile.android @@ -1,5 +1,5 @@ #!/usr/bin/env groovy -library 'status-jenkins-lib@v1.9.1' +library 'status-jenkins-lib@v1.9.6' pipeline { agent { label 'linux && x86_64 && nix-2.19' } @@ -38,7 +38,13 @@ pipeline { GOCACHE = "${WORKSPACE_TMP}/gocache" PATH = "${PATH}:${GOPATH}/bin" REPO_SRC = "${GOPATH}/src/github.com/status-im/status-go" - ARTIFACT = utils.pkgFilename(name: "status-go", type: "android", ext: "aar", version: sh(script: "./_assets/scripts/version.sh", returnStdout: true)) + VERSION = sh(script: "./_assets/scripts/version.sh", returnStdout: true) + ARTIFACT = utils.pkgFilename( + name: 'status-go', + type: env.PLATFORM, + version: env.VERSION, + ext: 'aar', + ) } stages { diff --git a/_assets/ci/Jenkinsfile.docker b/_assets/ci/Jenkinsfile.docker index b8116152a..2b61ce665 100644 --- a/_assets/ci/Jenkinsfile.docker +++ b/_assets/ci/Jenkinsfile.docker @@ -1,5 +1,5 @@ #!/usr/bin/env groovy -library 'status-jenkins-lib@v1.8.18' +library 'status-jenkins-lib@v1.9.6' pipeline { agent { label 'linux' } diff --git a/_assets/ci/Jenkinsfile.ios b/_assets/ci/Jenkinsfile.ios index 6fca25dd6..2ff5c5a27 100644 --- a/_assets/ci/Jenkinsfile.ios +++ b/_assets/ci/Jenkinsfile.ios @@ -1,5 +1,5 @@ #!/usr/bin/env groovy -library 'status-jenkins-lib@v1.9.1' +library 'status-jenkins-lib@v1.9.6' pipeline { agent { label 'macos && aarch64 && xcode-15.1 && nix-2.19' } @@ -38,7 +38,13 @@ pipeline { GOCACHE = "${WORKSPACE_TMP}/gocache" PATH = "${PATH}:${GOPATH}/bin" REPO_SRC = "${GOPATH}/src/github.com/status-im/status-go" - ARTIFACT = utils.pkgFilename(name: "status-go", type: "ios", ext: "zip", version: sh(script: "./_assets/scripts/version.sh", returnStdout: true)) + VERSION = sh(script: "./_assets/scripts/version.sh", returnStdout: true) + ARTIFACT = utils.pkgFilename( + name: 'status-go', + type: env.PLATFORM, + version: env.VERSION, + ext: 'zip', + ) /* fix for gomobile complaining about missing packages */ CGO_ENABLED = "1" } @@ -60,8 +66,7 @@ pipeline { stage('Archive') { steps { dir('build/bin') { - sh 'zip -r status-go-ios.zip Statusgo.xcframework' - sh "mv status-go-ios.zip ${WORKSPACE}/${ARTIFACT}" + sh "zip -r ${WORKSPACE}/${ARTIFACT} Statusgo.xcframework" } archiveArtifacts(ARTIFACT) } diff --git a/_assets/ci/Jenkinsfile.linux b/_assets/ci/Jenkinsfile.linux index bea06fcf5..e94614864 100644 --- a/_assets/ci/Jenkinsfile.linux +++ b/_assets/ci/Jenkinsfile.linux @@ -1,5 +1,5 @@ #!/usr/bin/env groovy -library 'status-jenkins-lib@v1.9.1' +library 'status-jenkins-lib@v1.9.6' pipeline { agent { label 'linux && x86_64 && nix-2.19' } @@ -38,7 +38,13 @@ pipeline { GOCACHE = "${WORKSPACE_TMP}/gocache" PATH = "${PATH}:${GOPATH}/bin" REPO_SRC = "${GOPATH}/src/github.com/status-im/status-go" - ARTIFACT = utils.pkgFilename(name: "status-go", type: "desktop", ext: "zip", version: sh(script: "./_assets/scripts/version.sh", returnStdout: true)) + VERSION = sh(script: "./_assets/scripts/version.sh", returnStdout: true) + ARTIFACT = utils.pkgFilename( + name: 'status-go', + type: env.PLATFORM, + version: env.VERSION, + ext: 'zip', + ) } stages { diff --git a/_assets/ci/Jenkinsfile.tests b/_assets/ci/Jenkinsfile.tests index 2a73c25aa..4e39510f9 100644 --- a/_assets/ci/Jenkinsfile.tests +++ b/_assets/ci/Jenkinsfile.tests @@ -1,5 +1,5 @@ #!/usr/bin/env groovy -library 'status-jenkins-lib@v1.8.18' +library 'status-jenkins-lib@v1.9.6' pipeline { agent { label 'linux && x86_64 && nix-2.19' } diff --git a/_assets/ci/Jenkinsfile.tests-rpc b/_assets/ci/Jenkinsfile.tests-rpc index 7ccb680de..d5d5635d4 100644 --- a/_assets/ci/Jenkinsfile.tests-rpc +++ b/_assets/ci/Jenkinsfile.tests-rpc @@ -1,4 +1,5 @@ -library 'status-jenkins-lib@v1.8.17' +#!/usr/bin/env groovy +library 'status-jenkins-lib@v1.9.6' pipeline { agent { label 'linux && x86_64 && nix-2.19' } @@ -40,18 +41,20 @@ pipeline { post { always { script { - archiveArtifacts artifacts: '**/results.xml', allowEmptyArchive: true - + archiveArtifacts( + artifacts: '**/results.xml', + allowEmptyArchive: true, + ) junit( testResults: '**/results.xml', skipOldReports: true, skipPublishingChecks: true, - skipMarkingBuildUnstable: true + skipMarkingBuildUnstable: true, ) } } success { script { github.notifyPR(true) } } failure { script { github.notifyPR(false) } } - cleanup { sh "make git-clean" } + cleanup { sh 'make git-clean' } } // post } // pipeline diff --git a/_assets/ci/validate-vendor.sh b/_assets/ci/validate-vendor.sh deleted file mode 100755 index 75cbde15d..000000000 --- a/_assets/ci/validate-vendor.sh +++ /dev/null @@ -1,62 +0,0 @@ -#!/usr/bin/env bash -# Copyright 2017 The Go Authors. All rights reserved. -# Use of this source code is governed by a BSD-style -# license that can be found in the LICENSE file. -# -# This script checks if we changed anything with regard to dependency management -# for our repo and makes sure that it was done in a valid way. -# -# This file is a copy of https://github.com/golang/dep/blob/master/hack/validate-vendor.bash -# with some comments added. - -set -e -o pipefail - -# Is validate upstream empty ? -if [ -z "$VALIDATE_UPSTREAM" ]; then - VALIDATE_REPO='https://github.com/status-im/status-go' - - if [ -z "$VALIDATE_BRANCH" ]; then - VALIDATE_BRANCH='develop' - fi - - VALIDATE_HEAD="$(git rev-parse --verify HEAD)" - - git fetch -q "$VALIDATE_REPO" "refs/heads/$VALIDATE_BRANCH" - VALIDATE_UPSTREAM="$(git rev-parse --verify FETCH_HEAD)" - - VALIDATE_COMMIT_DIFF="$VALIDATE_UPSTREAM...$VALIDATE_HEAD" - - validate_diff() { - if [ "$VALIDATE_UPSTREAM" != "$VALIDATE_HEAD" ]; then - git diff "$VALIDATE_COMMIT_DIFF" "$@" - fi - } -fi - -IFS=$'\n' -files=( $(validate_diff --diff-filter=ACMR --name-only -- 'Gopkg.toml' 'Gopkg.lock' 'vendor/' || true) ) -unset IFS - -# `files[@]` splits the content of files by whitespace and returns a list. -# `#` returns the number of the lines. -if [ ${#files[@]} -gt 0 ]; then - dep ensure -vendor-only - - # Let see if the working directory is clean - diffs="$(git status --porcelain -- vendor Gopkg.toml Gopkg.lock 2>/dev/null)" - if [ "$diffs" ]; then - { - echo 'The contents of vendor differ after "dep ensure":' - echo - echo "$diffs" - echo - echo 'Make sure these commands have been run before committing.' - echo - } >&2 - false - else - echo 'Congratulations! All vendoring changes are done the right way.' - fi -else - echo 'No vendor changes in diff.' -fi