From 3e6d908cb4cf732ef057a30df3e8267381f3f806 Mon Sep 17 00:00:00 2001 From: Sandeep Nishad Date: Mon, 15 May 2023 17:19:26 +0530 Subject: [PATCH] fix(ci): multiple bug fixes in weaver deployment workflows Go publish workflows: Correct the tagnames Node workflows: fix typo in package.json after changing version Fix a typo in relay deployment workflow Signed-off-by: Sandeep Nishad --- .../workflows/weaver_deploy_corda-pkgs.yml | 56 --------------- .github/workflows/weaver_deploy_go-pkgs.yml | 21 ++---- .github/workflows/weaver_deploy_node-pkgs.yml | 68 ------------------- .../workflows/weaver_deploy_relay-server.yml | 19 +----- 4 files changed, 7 insertions(+), 157 deletions(-) diff --git a/.github/workflows/weaver_deploy_corda-pkgs.yml b/.github/workflows/weaver_deploy_corda-pkgs.yml index 3d583dd12e..f37519b66b 100644 --- a/.github/workflows/weaver_deploy_corda-pkgs.yml +++ b/.github/workflows/weaver_deploy_corda-pkgs.yml @@ -6,14 +6,6 @@ name: Deploy Corda Packages on: push: - # branches: - # - main - # paths: - # - 'common/protos-java-kt/gradle.properties' - # - 'core/network/corda-interop-app/gradle.properties' - # - 'sdks/corda/gradle.properties' - # - 'core/drivers/corda-driver/VERSION' - tags: - v* @@ -46,18 +38,6 @@ jobs: cat github.properties working-directory: weaver/common/protos-java-kt - - name: Update version - run: | - VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') - # Strip "v" prefix from tag name - [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//') - echo $VERSION - if [[ $VERSION =~ ^[0-9]+\.[0-9]+\.[0-9]+[A-Za-z\-]*$ ]]; then - sed -i "s#version=.*#version=${VERSION}#g" gradle.properties - fi - cat gradle.properties - working-directory: weaver/common/protos-java-kt - - name: Publish run: | make publish > out 2> error @@ -95,18 +75,6 @@ jobs: cat github.properties working-directory: weaver/core/network/corda-interop-app - - name: Update version - run: | - VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') - # Strip "v" prefix from tag name - [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//') - echo $VERSION - if [[ $VERSION =~ ^[0-9]+\.[0-9]+\.[0-9]+[A-Za-z\-]*$ ]]; then - sed -i "s#version=.*#version=${VERSION}#g" gradle.properties - fi - cat gradle.properties - working-directory: weaver/core/network/corda-interop-app - - name: Build run: make build working-directory: weaver/core/network/corda-interop-app @@ -147,18 +115,6 @@ jobs: cat github.properties working-directory: weaver/sdks/corda - - name: Update version - run: | - VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') - # Strip "v" prefix from tag name - [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//') - echo $VERSION - if [[ $VERSION =~ ^[0-9]+\.[0-9]+\.[0-9]+[A-Za-z\-]*$ ]]; then - sed -i "s#version=.*#version=${VERSION}#g" gradle.properties - fi - cat gradle.properties - working-directory: weaver/sdks/corda - - name: Build run: make build working-directory: weaver/sdks/corda @@ -199,18 +155,6 @@ jobs: echo "url=https://maven.pkg.github.com/${GITHUB_REPOSITORY_OWNER}/cacti" >> github.properties cat github.properties working-directory: weaver/core/drivers/corda-driver - - - name: Update version - run: | - VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') - # Strip "v" prefix from tag name - [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//') - echo $VERSION - if [[ $VERSION =~ ^[0-9]+\.[0-9]+\.[0-9]+[A-Za-z\-]*$ ]]; then - echo -n $VERSION > VERSION - fi - cat VERSION - working-directory: weaver/core/drivers/corda-driver - name: Check if package already exists run: (make check-if-tag-exists && echo "CORDA_DRIVER_PUSH=true" >> $GITHUB_ENV) || echo "CORDA_DRIVER_PUSH=false" >> $GITHUB_ENV diff --git a/.github/workflows/weaver_deploy_go-pkgs.yml b/.github/workflows/weaver_deploy_go-pkgs.yml index bceed1e58a..811f6096a3 100644 --- a/.github/workflows/weaver_deploy_go-pkgs.yml +++ b/.github/workflows/weaver_deploy_go-pkgs.yml @@ -6,15 +6,6 @@ name: Deploy Go Modules on: push: - # branches: - # - main - # paths: - # - 'common/protos-go/VERSION' - # - 'core/network/fabric-interop-cc/libs/utils/VERSION' - # - 'core/network/fabric-interop-cc/libs/assetexchange/VERSION' - # - 'core/network/fabric-interop-cc/interfaces/asset-mgmt/VERSION' - # - 'core/network/fabric-interop-cc/contracts/interop/VERSION' - # - 'sdks/fabric/go-sdk/VERSION' tags: - v* @@ -34,7 +25,7 @@ jobs: - name: Set module tag and description run: | - echo "MODULE_TAG=common/protos-go" >> $GITHUB_ENV + echo "MODULE_TAG=weaver/common/protos-go" >> $GITHUB_ENV echo "MODULE_DESC=GO Weaver Protos" >> $GITHUB_ENV - name: Update version @@ -96,7 +87,7 @@ jobs: - name: Set module tag and description run: | - echo "MODULE_TAG=core/network/fabric-interop-cc/libs/utils" >> $GITHUB_ENV + echo "MODULE_TAG=weaver/core/network/fabric-interop-cc/libs/utils" >> $GITHUB_ENV echo "MODULE_DESC=GO Fabric Utils Library for Interoperation" >> $GITHUB_ENV - name: Update version @@ -162,7 +153,7 @@ jobs: - name: Set module tag and description run: | - echo "MODULE_TAG=core/network/fabric-interop-cc/libs/assetexchange" >> $GITHUB_ENV + echo "MODULE_TAG=weaver/core/network/fabric-interop-cc/libs/assetexchange" >> $GITHUB_ENV echo "MODULE_DESC=GO Fabric Library for Asset Exchange" >> $GITHUB_ENV - name: Update version @@ -228,7 +219,7 @@ jobs: - name: Set module tag and description run: | - echo "MODULE_TAG=core/network/fabric-interop-cc/interfaces/asset-mgmt" >> $GITHUB_ENV + echo "MODULE_TAG=weaver/core/network/fabric-interop-cc/interfaces/asset-mgmt" >> $GITHUB_ENV echo "MODULE_DESC=GO Fabric Asset Management Interface" >> $GITHUB_ENV - name: Update version @@ -294,7 +285,7 @@ jobs: - name: Set module tag and description run: | - echo "MODULE_TAG=core/network/fabric-interop-cc/contracts/interop" >> $GITHUB_ENV + echo "MODULE_TAG=weaver/core/network/fabric-interop-cc/contracts/interop" >> $GITHUB_ENV echo "MODULE_DESC=GO Fabric Interop Chaincode" >> $GITHUB_ENV - name: Update version @@ -360,7 +351,7 @@ jobs: - name: Set module tag and description run: | - echo "MODULE_TAG=sdks/fabric/go-sdk" >> $GITHUB_ENV + echo "MODULE_TAG=weaver/sdks/fabric/go-sdk" >> $GITHUB_ENV echo "MODULE_DESC=GO Fabric Weaver SDK" >> $GITHUB_ENV - name: Update version diff --git a/.github/workflows/weaver_deploy_node-pkgs.yml b/.github/workflows/weaver_deploy_node-pkgs.yml index f8b5a6d868..fd78702fca 100644 --- a/.github/workflows/weaver_deploy_node-pkgs.yml +++ b/.github/workflows/weaver_deploy_node-pkgs.yml @@ -6,14 +6,6 @@ name: Deploy Node JS Packages on: push: - # branches: - # - main - # paths: - # - 'common/protos-js/package.json' - # - 'sdks/fabric/interoperation-node-sdk/package.json' - # - 'sdks/besu/node/package.json' - # - 'core/drivers/fabric-driver/VERSION' - # - 'core/identity-management/iin-agent/VERSION' tags: - v* @@ -49,18 +41,6 @@ jobs: cat .npmrc working-directory: weaver/common/protos-js - - name: Update version - run: | - VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') - # Strip "v" prefix from tag name - [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//') - echo $VERSION - if [[ $VERSION =~ ^[0-9]+\.[0-9]+\.[0-9]+[A-Za-z\-]*$ ]]; then - sed -i "s#\"version\":.*#\"version\": \"${VERSION}\"#g" package.json - fi - head -4 package.json - working-directory: weaver/common/protos-js - - name: Build run: | export PATH="$PATH:${GITHUB_WORKSPACE}/protoc/bin" @@ -108,18 +88,6 @@ jobs: cat .npmrc working-directory: weaver/sdks/fabric/interoperation-node-sdk - - name: Update version - run: | - VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') - # Strip "v" prefix from tag name - [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//') - echo $VERSION - if [[ $VERSION =~ ^[0-9]+\.[0-9]+\.[0-9]+[A-Za-z\-]*$ ]]; then - sed -i "s#\"version\":.*#\"version\": \"${VERSION}\"#g" package.json - fi - head -4 package.json - working-directory: weaver/sdks/fabric/interoperation-node-sdk - - name: Build run: make build working-directory: weaver/sdks/fabric/interoperation-node-sdk @@ -165,18 +133,6 @@ jobs: cat .npmrc working-directory: weaver/sdks/besu/node - - name: Update version - run: | - VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') - # Strip "v" prefix from tag name - [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//') - echo $VERSION - if [[ $VERSION =~ ^[0-9]+\.[0-9]+\.[0-9]+[A-Za-z\-]*$ ]]; then - sed -i "s#\"version\":.*#\"version\": \"${VERSION}\"#g" package.json - fi - head -4 package.json - working-directory: weaver/sdks/besu/node - - name: Build run: make build working-directory: weaver/sdks/besu/node @@ -223,18 +179,6 @@ jobs: sed -i "s//${{ secrets.GITHUB_TOKEN }}/g" .npmrc cat .npmrc working-directory: weaver/core/drivers/fabric-driver - - - name: Update version - run: | - VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') - # Strip "v" prefix from tag name - [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//') - echo $VERSION - if [[ $VERSION =~ ^[0-9]+\.[0-9]+\.[0-9]+[A-Za-z\-]*$ ]]; then - echo -n $VERSION > VERSION - fi - cat VERSION - working-directory: weaver/core/drivers/fabric-driver - name: Check if package already exists run: (make check-if-tag-exists && echo "FABRIC_DRIVER_PUSH=true" >> $GITHUB_ENV) || echo "FABRIC_DRIVER_PUSH=false" >> $GITHUB_ENV @@ -275,18 +219,6 @@ jobs: sed -i "s//${{ secrets.GITHUB_TOKEN }}/g" .npmrc cat .npmrc working-directory: weaver/core/identity-management/iin-agent - - - name: Update version - run: | - VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') - # Strip "v" prefix from tag name - [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//') - echo $VERSION - if [[ $VERSION =~ ^[0-9]+\.[0-9]+\.[0-9]+[A-Za-z\-]*$ ]]; then - echo -n $VERSION > VERSION - fi - cat VERSION - working-directory: weaver/core/identity-management/iin-agent - name: Check if package already exists run: (make check-if-tag-exists && echo "IINAGENT_PUSH=true" >> $GITHUB_ENV) || echo "IINAGENT_PUSH=false" >> $GITHUB_ENV diff --git a/.github/workflows/weaver_deploy_relay-server.yml b/.github/workflows/weaver_deploy_relay-server.yml index ce7e02ab1f..a1ec4ed5da 100644 --- a/.github/workflows/weaver_deploy_relay-server.yml +++ b/.github/workflows/weaver_deploy_relay-server.yml @@ -6,11 +6,6 @@ name: Deploy Relay Docker Image on: push: - # branches: - # - main - # paths: - # - 'common/protos-rs/pkg/Cargo.toml' - # - 'core/relay/VERSION' tags: - v* @@ -36,18 +31,6 @@ jobs: toolchain: stable components: rustfmt, clippy - - name: Update version - run: | - VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') - # Strip "v" prefix from tag name - [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//') - echo $VERSION - if [[ $VERSION =~ ^[0-9]+\.[0-9]+\.[0-9]+[A-Za-z\-]*$ ]]; then - sed -i "s#^version\ *=.*#version = ${VERSION}#g" Cargo.toml - fi - head -4 Cargo.toml - working-directory: weaver/common/protos-rs/pkg - - name: Publish run: cargo publish --token ${CRATES_TOKEN} env: @@ -56,7 +39,7 @@ jobs: publish-relay-image: if: github.repository_owner == 'hyperledger' - needs: publish_protos-rs + needs: publish-protos-rs runs-on: ubuntu-latest permissions: packages: write