Skip to content

Commit 3651c1b

Browse files
committed
Deploy Go Workflow: Hardcode paths to gomodules, index by module name
Signed-off-by: sandeep.nishad1 <[email protected]>
1 parent d4a2f68 commit 3651c1b

File tree

1 file changed

+29
-10
lines changed

1 file changed

+29
-10
lines changed

.github/workflows/deploy_go-pkgs.yml

Lines changed: 29 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ on:
44
# Allows you to run this workflow manually from the Actions tab
55
workflow_dispatch:
66
inputs:
7-
tag:
8-
description: 'Go Module path wrt root of repo'
9-
default: 'common/protos-go'
7+
module:
8+
description: 'Go Module name'
9+
default: 'protos-go'
1010
required: true
11-
name:
12-
description: 'Go Module Name'
11+
module_description:
12+
description: 'Small Go Module Description for Release Text'
1313
default: 'Weaver Protos Go'
1414
required: true
1515
version:
@@ -27,18 +27,37 @@ jobs:
2727
- name: Set current date as env
2828
run: echo "RELEASE_DATE=$(date +%b\ %d,\ %Y)" >> $GITHUB_ENV
2929

30+
- name: Get Full path
31+
run: |
32+
if [ "${{ github.event.inputs.module }}" = "protos-go" ]; then
33+
echo "MODULE_TAG=common/protos-go" >> $GITHUB_ENV
34+
elif [ "${{ github.event.inputs.module }}" = "interop" ]; then
35+
echo "MODULE_TAG=core/network/fabric-interop-cc/contracts/interop" >> $GITHUB_ENV
36+
elif [ "${{ github.event.inputs.module }}" = "utils" ]; then
37+
echo "MODULE_TAG=core/network/fabric-interop-cc/libs/utils" >> $GITHUB_ENV
38+
elif [ "${{ github.event.inputs.module }}" = "assetexchange" ]; then
39+
echo "MODULE_TAG=core/network/fabric-interop-cc/libs/assetexchange" >> $GITHUB_ENV
40+
elif [ "${{ github.event.inputs.module }}" = "asset-mgmt" ]; then
41+
echo "MODULE_TAG=core/network/fabric-interop-cc/interfaces/asset-mgmt" >> $GITHUB_ENV
42+
elif [ "${{ github.event.inputs.module }}" = "go-sdk" ]; then
43+
echo "MODULE_TAG=sdks/fabric/go-sdk" >> $GITHUB_ENV
44+
else
45+
echo "Module not known to the workflow. Exiting."
46+
exit 1
47+
fi
48+
3049
- name: Create GO Release
3150
id: go-release
3251
uses: actions/create-release@v1
3352
env:
3453
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
3554
with:
36-
tag_name: ${{ github.event.inputs.tag }}/${{ github.event.inputs.version }}
37-
release_name: ${{ github.event.inputs.version }} - ${{ github.event.inputs.name }} - ${{ env.RELEASE_DATE }}
55+
tag_name: ${{ env.MODULE_TAG }}/${{ github.event.inputs.version }}
56+
release_name: ${{ github.event.inputs.version }} - ${{ github.event.inputs.module_description }} - ${{ env.RELEASE_DATE }}
3857
body: |
39-
- Go Module: `github.com/${GITHUB_REPOSITORY_OWNER}/weaver-dlt-interoperability/${{ github.event.inputs.tag }}`
58+
- Go Module: `github.com/${GITHUB_REPOSITORY_OWNER}/weaver-dlt-interoperability/${{ env.MODULE_TAG }}`
4059
- Release: ${{ github.event.inputs.version }}
41-
- Readme: [Here](https://github.com/${GITHUB_REPOSITORY_OWNER}/weaver-dlt-interoperability/blob/${{ github.event.inputs.tag }}/${{ github.event.inputs.version }}/${{ github.event.inputs.tag }}/README.md).
42-
- Source: [Here](https://github.com/${GITHUB_REPOSITORY_OWNER}/weaver-dlt-interoperability/blob/${{ github.event.inputs.tag }}/${{ github.event.inputs.version }}/${{ github.event.inputs.tag }})
60+
- Readme: [Here](https://github.com/${GITHUB_REPOSITORY_OWNER}/weaver-dlt-interoperability/blob/${{ env.MODULE_TAG }}/${{ github.event.inputs.version }}/${{ env.MODULE_TAG }}/README.md).
61+
- Source: [Here](https://github.com/${GITHUB_REPOSITORY_OWNER}/weaver-dlt-interoperability/blob/${{ env.MODULE_TAG }}/${{ github.event.inputs.version }}/${{ env.MODULE_TAG }})
4362
draft: false
4463
prerelease: false

0 commit comments

Comments
 (0)