Skip to content

Commit

Permalink
fix(ci): multiple bug fixes in weaver deployment workflows
Browse files Browse the repository at this point in the history
    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 <sandeep.nishad1@ibm.com>
  • Loading branch information
sandeepnRES committed May 19, 2023
1 parent 7abf3dd commit 3e6d908
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 157 deletions.
56 changes: 0 additions & 56 deletions .github/workflows/weaver_deploy_corda-pkgs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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*

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
21 changes: 6 additions & 15 deletions .github/workflows/weaver_deploy_go-pkgs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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*

Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
68 changes: 0 additions & 68 deletions .github/workflows/weaver_deploy_node-pkgs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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*

Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -223,18 +179,6 @@ jobs:
sed -i "s/<personal-access-token>/${{ 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
Expand Down Expand Up @@ -275,18 +219,6 @@ jobs:
sed -i "s/<personal-access-token>/${{ 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
Expand Down
19 changes: 1 addition & 18 deletions .github/workflows/weaver_deploy_relay-server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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*

Expand All @@ -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:
Expand All @@ -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
Expand Down

0 comments on commit 3e6d908

Please sign in to comment.