Skip to content

Commit e9d7688

Browse files
committed
add CI step to check that versions match
1 parent da1af78 commit e9d7688

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

.github/workflows/check-js-build.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,27 @@ on: push
22

33
jobs:
44
check-js-build:
5-
name: Check JS build artifacts
5+
name: Check JS version number and build artifacts
66
runs-on: ubuntu-latest
77
steps:
88
- uses: actions/checkout@v4
99
- name: Set up Python
1010
uses: actions/setup-python@v5
1111
with:
1212
python-version: "3.x"
13-
13+
14+
- name: Check that version number for JS project matches version number for Python project
15+
run: |
16+
PYPROJECT_PATH="pyproject.toml"
17+
PKGJSON_PATH="js/package.json"
18+
PYPROJECT_VERSION=$(awk -F'"' '/^version/ {print $2; exit}' $PYPROJECT_PATH)
19+
JSPROJECT_VERSION=$(cat $PKGJSON_PATH | jq -r '.version')
20+
if [ "$PYPROJECT_VERSION" != "$JSPROJECT_VERSION" ]; then
21+
echo "❌ Version number $JSPROJECT_VERSION in $PKGJSON_PATH does not match version number $PYPROJECT_VERSION in $PYPROJECT_PATH"
22+
exit 1
23+
else
24+
echo "✅ Version number $JSPROJECT_VERSION in $PKGJSON_PATH matches version number $PYPROJECT_VERSION in $PYPROJECT_PATH"
25+
fi
1426
- name: Install Node
1527
uses: actions/setup-node@v2
1628
with:

0 commit comments

Comments
 (0)