Skip to content

Commit 65f1523

Browse files
authored
Merge pull request #75 from binance/rc-common-v1.0.0
2 parents 11b14dc + dfe0531 commit 65f1523

File tree

5 files changed

+50
-18
lines changed

5 files changed

+50
-18
lines changed

.github/workflows/release.yaml

Lines changed: 36 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,40 @@ jobs:
1313
clients: ${{ steps.detect.outputs.clients }}
1414
steps:
1515
- name: Checkout repository
16-
uses: actions/checkout@v4
16+
uses: actions/checkout@v6
17+
with:
18+
fetch-depth: 2
1719

1820
- name: Detect all clients
1921
id: detect
2022
run: |
21-
ALL_CLIENTS=$(ls -d clients/*/ | xargs -n 1 basename | jq -R -s -c 'split("\n")[:-1]')
22-
echo "Detected all clients: $ALL_CLIENTS"
23-
echo "clients=$ALL_CLIENTS" >> $GITHUB_OUTPUT
23+
ALL_CLIENTS=$(ls -d clients/*/ | xargs -n 1 basename)
24+
CHANGED_CLIENTS=()
25+
PREV_COMMIT=$(git rev-parse HEAD~1)
26+
27+
# Check each client directory for changes
28+
for client in $ALL_CLIENTS; do
29+
if git diff --quiet $PREV_COMMIT HEAD -- clients/$client/; then
30+
echo "No changes detected in $client"
31+
else
32+
CHANGED_CLIENTS+=("$client")
33+
fi
34+
done
35+
36+
if git diff --quiet $PREV_COMMIT HEAD -- common/; then
37+
echo "No changes detected in common"
38+
else
39+
CHANGED_CLIENTS+=("common")
40+
fi
41+
42+
if [ ${#CHANGED_CLIENTS[@]} -eq 0 ]; then
43+
CHANGED_CLIENTS_JSON="[]"
44+
else
45+
CHANGED_CLIENTS_JSON=$(printf '%s\n' "${CHANGED_CLIENTS[@]}" | jq -R -s -c 'split("\n")[:-1]')
46+
fi
47+
48+
echo "Detected changed clients: $CHANGED_CLIENTS_JSON"
49+
echo "clients=$CHANGED_CLIENTS_JSON" >> $GITHUB_OUTPUT
2450
2551
release:
2652
needs: detect-clients
@@ -82,7 +108,7 @@ jobs:
82108
echo "package_path=./" >> $GITHUB_OUTPUT
83109
else
84110
echo "dir=clients/${{ matrix.client }}" >> $GITHUB_OUTPUT
85-
echo "package_path=./src" >> $GITHUB_OUTPUT
111+
echo "package_path=./" >> $GITHUB_OUTPUT
86112
fi
87113
88114
- name: Set up Go environment
@@ -147,7 +173,11 @@ jobs:
147173
fi
148174
149175
# Set the full tag name
150-
FULL_TAG="${{ matrix.client }}/$NEW_VERSION"
176+
if [ "${{ matrix.client }}" == "common" ]; then
177+
FULL_TAG="common/$NEW_VERSION"
178+
else
179+
FULL_TAG="clients/${{ matrix.client }}/$NEW_VERSION"
180+
fi
151181
echo "tag=$FULL_TAG" >> $GITHUB_OUTPUT
152182
echo "version=$NEW_VERSION" >> $GITHUB_OUTPUT
153183

common/.gitignore

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1-
coverage.txt
2-
*.DS_Store
3-
.idea
1+
dist
2+
.env
3+
4+
# IntelliJ
5+
.idea

common/CHANGELOG.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1-
## 1.0.0 - 2025-12-15
1+
### Changelog
22

3-
- Initial release
3+
## 1.0.0 - 2025-12-16
4+
5+
- Initial release

common/go.mod

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,14 @@ require (
88
github.com/andybalholm/brotli v1.2.0
99
github.com/google/uuid v1.6.0
1010
github.com/gorilla/websocket v1.5.3
11+
github.com/stretchr/testify v1.11.1
1112
github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78
1213
golang.org/x/net v0.47.0
1314
)
1415

1516
require (
1617
github.com/davecgh/go-spew v1.1.1 // indirect
1718
github.com/pmezard/go-difflib v1.0.0 // indirect
18-
github.com/stretchr/objx v0.5.2 // indirect
19-
github.com/stretchr/testify v1.11.1 // indirect
20-
golang.org/x/crypto v0.44.0 // indirect
19+
golang.org/x/crypto v0.46.0 // indirect
2120
gopkg.in/yaml.v3 v3.0.1 // indirect
2221
)

common/go.sum

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,17 @@ github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aN
88
github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
99
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
1010
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
11-
github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY=
12-
github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA=
1311
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
1412
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
1513
github.com/xyproto/randomstring v1.0.5 h1:YtlWPoRdgMu3NZtP45drfy1GKoojuR7hmRcnhZqKjWU=
1614
github.com/xyproto/randomstring v1.0.5/go.mod h1:rgmS5DeNXLivK7YprL0pY+lTuhNQW3iGxZ18UQApw/E=
1715
github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78 h1:ilQV1hzziu+LLM3zUTJ0trRztfwgjqKnBWNtSRkbmwM=
1816
github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78/go.mod h1:aL8wCCfTfSfmXjznFBSZNN13rSJjlIOI1fUNAtF7rmI=
19-
golang.org/x/crypto v0.44.0 h1:A97SsFvM3AIwEEmTBiaxPPTYpDC47w720rdiiUvgoAU=
20-
golang.org/x/crypto v0.44.0/go.mod h1:013i+Nw79BMiQiMsOPcVCB5ZIJbYkerPrGnOa00tvmc=
17+
golang.org/x/crypto v0.46.0 h1:cKRW/pmt1pKAfetfu+RCEvjvZkA9RimPbh7bhFjGVBU=
18+
golang.org/x/crypto v0.46.0/go.mod h1:Evb/oLKmMraqjZ2iQTwDwvCtJkczlDuTmdJXoZVzqU0=
2119
golang.org/x/net v0.47.0 h1:Mx+4dIFzqraBXUugkia1OOvlD6LemFo1ALMHjrXDOhY=
2220
golang.org/x/net v0.47.0/go.mod h1:/jNxtkgq5yWUGYkaZGqo27cfGZ1c5Nen03aYrrKpVRU=
21+
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
2322
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
2423
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
2524
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

0 commit comments

Comments
 (0)