-
Notifications
You must be signed in to change notification settings - Fork 286
169 lines (137 loc) · 6.62 KB
/
test_weaver-pre-release.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
# Copyright IBM Corp. All Rights Reserved.
#
# SPDX-License-Identifier: CC-BY-4.0
name: Pre-release Test Weaver Module versions
on:
pull_request:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
check_release:
outputs:
status: ${{ steps.early.outputs.status }}
runs-on: ubuntu-22.04
steps:
- uses: actions/[email protected]
- name: Ignore if not a release PR
id: early
env:
TITLE: ${{ github.event.pull_request.title }}
run : |
status="skip"
if echo ${TITLE} | grep -q "chore(release)"; then
status="continue"
fi
echo "status=$status" >> $GITHUB_OUTPUT
test_weaver_pre-release:
needs: check_release
if: needs.check_release.outputs.status == 'continue'
runs-on: ubuntu-22.04
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/[email protected]
- name: Get release verison from PR title
env:
TITLE: ${{ github.event.pull_request.title }}
run: |
# Assuming release PR follows pattern: chore(release): publish vA.B.C
# Split PR title by space, and take 3rd word
VERSION=$(echo "${TITLE}" | cut -d ' ' -f 3)
# Strip "v" from version
VERSION=$(echo $VERSION | sed -e 's/^v//')
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo $VERSION
# Gradle
- name: check weaver/common/protos-java-kt/gradle.properties
run: cat gradle.properties | grep "version=" | grep $VERSION || exit 1
working-directory: weaver/common/protos-java-kt
- name: check weaver/core/network/corda-interop-app/gradle.properties
run: cat gradle.properties | grep "version=" | grep $VERSION || exit 1
working-directory: weaver/core/network/corda-interop-app
- name: check weaver/sdks/corda/gradle.properties
run: cat gradle.properties | grep "version=" | grep $VERSION || exit 1
working-directory: weaver/sdks/corda
- name: check weaver/core/drivers/corda-driver/gradle.properties
run: cat gradle.properties | grep "version=" | grep $VERSION || exit 1
working-directory: weaver/core/drivers/corda-driver
# NodeJS
- name: check weaver/common/protos-js/package.json
run: cat package.json | grep "version" | grep $VERSION || exit 1
working-directory: weaver/common/protos-js
- name: check weaver/sdks/fabric/interoperation-node-sdk/package.json
run: cat package.json | grep "version" | grep $VERSION || exit 1
working-directory: weaver/sdks/fabric/interoperation-node-sdk
- name: check weaver/sdks/besu/node/package.json
run: cat package.json | grep "version" | grep $VERSION || exit 1
working-directory: weaver/sdks/besu/node
- name: check weaver/core/drivers/fabric-driver/package.json
run: cat package.json | grep "version" | grep $VERSION || exit 1
working-directory: weaver/core/drivers/fabric-driver
- name: check weaver/core/identity-management/iin-agent/package.json
run: cat package.json | grep "version" | grep $VERSION || exit 1
working-directory: weaver/core/identity-management/iin-agent
# Rust
- name: check weaver/common/protos-rs/pkg/Cargo.toml
run: cat Cargo.toml | grep "^version" | grep $VERSION || exit 1
working-directory: weaver/common/protos-rs/pkg
- name: check weaver/core/relay/Cargo.toml
run: cat Cargo.toml | grep "^version" | grep $VERSION || exit 1
working-directory: weaver/core/relay
# Docker
- name: check weaver/core/drivers/corda-driver/VERSION
run: cat VERSION | grep $VERSION || exit 1
working-directory: weaver/core/drivers/corda-driver
- name: check weaver/core/drivers/fabric-driver/VERSION
run: cat VERSION | grep $VERSION || exit 1
working-directory: weaver/core/drivers/fabric-driver
- name: check weaver/core/identity-management/iin-agent/VERSION
run: cat VERSION | grep $VERSION || exit 1
working-directory: weaver/core/identity-management/iin-agent
- name: check weaver/core/relay/VERSION
run: cat VERSION | grep $VERSION || exit 1
working-directory: weaver/core/relay
# GO
- name: check weaver/common/protos-go/VERSION
run: cat VERSION | grep $VERSION || exit 1
working-directory: weaver/common/protos-go
- name: check weaver/core/network/fabric-interop-cc/libs/utils/VERSION
run: cat VERSION | grep $VERSION || exit 1
working-directory: weaver/core/network/fabric-interop-cc/libs/utils
- name: check weaver/core/network/fabric-interop-cc/libs/assetexchange/VERSION
run: cat VERSION | grep $VERSION || exit 1
working-directory: weaver/core/network/fabric-interop-cc/libs/assetexchange
- name: check weaver/core/network/fabric-interop-cc/interfaces/asset-mgmt/VERSION
run: cat VERSION | grep $VERSION || exit 1
working-directory: weaver/core/network/fabric-interop-cc/interfaces/asset-mgmt
- name: check weaver/core/network/fabric-interop-cc/contracts/interop/VERSION
run: cat VERSION | grep $VERSION || exit 1
working-directory: weaver/core/network/fabric-interop-cc/contracts/interop
- name: check weaver/sdks/fabric/go-sdk/VERSION
run: cat VERSION | grep $VERSION || exit 1
working-directory: weaver/sdks/fabric/go-sdk
test_weaver_go_pre-release:
needs: check_release
if: needs.check_release.outputs.status == 'continue'
runs-on: ubuntu-22.04
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/[email protected]
- name: Get release verison from PR title
env:
TITLE: ${{ github.event.pull_request.title }}
run: |
# Assuming release PR follows pattern: chore(release): publish vA.B.C
# Split PR title by space, and take 3rd word
VERSION=$(echo "${TITLE}" | cut -d ' ' -f 3)
# Strip "v" from version
VERSION=$(echo $VERSION | sed -e 's/^v//')
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo $VERSION
- name: Update GO Checksum
run: ./go-gen-checksum.sh $VERSION
working-directory: tools
- name: Check if changes are committed
run: (git status | grep "nothing to commit, working tree clean") || (echo "go-gen-checksum not called before release commit" && exit 1)