Skip to content

Commit

Permalink
ci(root): improve RELEASE_CHECK file layout and check versions match
Browse files Browse the repository at this point in the history
improve the layout of the release check file, so it is easily readable on new lines. Additionally,
the versions for react and web-components will be checked in canary/stable, including the v3
branches

2765
  • Loading branch information
MI6-255 committed Feb 24, 2025
1 parent 7fe73dc commit 7cab72a
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 2 deletions.
23 changes: 22 additions & 1 deletion .github/workflows/ic-ui-kit-release-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,29 @@ jobs:
- name: Run release check
run: |
RELEASE_CHECK=$((echo y; sleep 0.5; echo $'\n';) | npm run release-check)
echo "VERSION=$(echo $RELEASE_CHECK)" >> $GITHUB_ENV
RELEASE_CHECK=$(echo "$RELEASE_CHECK" | sed 's/ - @/\n- @/g')
echo "VERSION<<EOF" >> $GITHUB_ENV
echo "$RELEASE_CHECK" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
git stash
- name: Extract and compare versions
run: |
REACT_VERSION=$(echo "${{ env.VERSION }}" | grep '@ukic/react' | sed -n 's/.*=> \([0-9.]*\(-[a-zA-Z0-9.]*\)*\).*/\1/p')
WEB_COMPONENTS_VERSION=$(echo "${{ env.VERSION }}" | grep '@ukic/web-components' | sed -n 's/.*=> \([0-9.]*\(-[a-zA-Z0-9.]*\)*\).*/\1/p')
CANARY_REACT_VERSION=$(echo "${{ env.VERSION }}" | grep '@ukic/canary-react' | sed -n 's/.*=> \([0-9.]*-canary.[0-9]*\).*/\1/p')
CANARY_WEB_COMPONENTS_VERSION=$(echo "${{ env.VERSION }}" | grep '@ukic/canary-web-components' | sed -n 's/.*=> \([0-9.]*-canary.[0-9]*\).*/\1/p')
echo "React version: $REACT_VERSION"
echo "Web Components version: $WEB_COMPONENTS_VERSION"
echo "Canary React version: $CANARY_REACT_VERSION"
echo "Canary Web Components version: $CANARY_WEB_COMPONENTS_VERSION"
if [ "$REACT_VERSION" != "$WEB_COMPONENTS_VERSION" ]; then
echo "Error: The versions of @ukic/react and @ukic/web-components packages are not identical."
exit 1
fi
if [ "$CANARY_REACT_VERSION" != "$CANARY_WEB_COMPONENTS_VERSION" ]; then
echo "Error: The versions of @ukic/canary-react and @ukic/canary-web-components packages are not identical."
exit 1
fi
- name: Configure Git user
run: |
git config --global user.name ${{ secrets.USERNAME }}
Expand Down
23 changes: 22 additions & 1 deletion .github/workflows/ic-ui-kit-release-v3-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,29 @@ jobs:
- name: Run release check
run: |
RELEASE_CHECK=$((echo y; sleep 0.5; echo $'\n';) | npm run release-check)
echo "VERSION=$(echo $RELEASE_CHECK)" >> $GITHUB_ENV
RELEASE_CHECK=$(echo "$RELEASE_CHECK" | sed 's/ - @/\n- @/g')
echo "VERSION<<EOF" >> $GITHUB_ENV
echo "$RELEASE_CHECK" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
git stash
- name: Extract and compare versions
run: |
REACT_VERSION=$(echo "${{ env.VERSION }}" | grep '@ukic/react' | sed -n 's/.*=> \([0-9.]*\(-[a-zA-Z0-9.]*\)*\).*/\1/p')
WEB_COMPONENTS_VERSION=$(echo "${{ env.VERSION }}" | grep '@ukic/web-components' | sed -n 's/.*=> \([0-9.]*\(-[a-zA-Z0-9.]*\)*\).*/\1/p')
CANARY_REACT_VERSION=$(echo "${{ env.VERSION }}" | grep '@ukic/canary-react' | sed -n 's/.*=> \([0-9.]*-canary.[0-9]*\).*/\1/p')
CANARY_WEB_COMPONENTS_VERSION=$(echo "${{ env.VERSION }}" | grep '@ukic/canary-web-components' | sed -n 's/.*=> \([0-9.]*-canary.[0-9]*\).*/\1/p')
echo "React version: $REACT_VERSION"
echo "Web Components version: $WEB_COMPONENTS_VERSION"
echo "Canary React version: $CANARY_REACT_VERSION"
echo "Canary Web Components version: $CANARY_WEB_COMPONENTS_VERSION"
if [ "$REACT_VERSION" != "$WEB_COMPONENTS_VERSION" ]; then
echo "Error: The versions of @ukic/react and @ukic/web-components packages are not identical."
exit 1
fi
if [ "$CANARY_REACT_VERSION" != "$CANARY_WEB_COMPONENTS_VERSION" ]; then
echo "Error: The versions of @ukic/canary-react and @ukic/canary-web-components packages are not identical."
exit 1
fi
- name: Configure Git user
run: |
git config --global user.name ${{ secrets.USERNAME }}
Expand Down

0 comments on commit 7cab72a

Please sign in to comment.