-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
75f313a
commit d6a5fbe
Showing
6 changed files
with
78 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: Test - Check SDK version | ||
|
||
on: | ||
pull_request | ||
|
||
jobs: | ||
check-sdk-version: | ||
runs-on: ubuntu-20.04 | ||
|
||
steps: | ||
- name: 🏗 Setup repo | ||
uses: actions/checkout@v3 | ||
|
||
- name: 📦 Check it is using the latest version of the SDK | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18.12.1 | ||
- run: corepack enable | ||
- run: yarn install --immutable | ||
- run: yarn run updateSdkVersion $GITHUB_BASE_REF check |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!/bin/bash | ||
|
||
BRANCH=${1-default} | ||
CHECK=${2-default} | ||
|
||
echo "yarn run updateSdkVersion $@" | ||
|
||
set +e | ||
|
||
# Get the latest version of the SDK for the correct npmjs tag based on branch | ||
if [ "${BRANCH}" == "master" ]; then | ||
VERSION=$(npm view @tonomy/tonomy-id-sdk version) | ||
elif [ "${BRANCH}" == "development" ]; then | ||
VERSION=$(npm view @tonomy/tonomy-id-sdk@development version) | ||
else | ||
# Print help | ||
echo "Usage: yarn run updateSdkVersion master|development [check]" | ||
echo "" | ||
echo "Example: yarn run updateSdkVersion development" | ||
echo "Example: yarn run updateSdkVersion master check" | ||
echo "" | ||
exit 1 | ||
fi | ||
|
||
# Get the sha256sum of yarn.lock before updating the SDK | ||
YARNLOCK_SHA256_OLD=$(sha256sum yarn.lock) | ||
|
||
# Update the SDK | ||
echo "Updating package @tonomy/tonomy-id-sdk@${VERSION}" | ||
yarn up "@tonomy/tonomy-id-sdk@${VERSION}" | ||
|
||
# Get the sha256sum of yarn.lock after updating the SDK | ||
YARNLOCK_SHA256_NEW=$(sha256sum yarn.lock) | ||
|
||
if [ "${CHECK}" == "check" ]; then | ||
echo "Checking if yarn.lock has changed" | ||
if [ "${YARNLOCK_SHA256_NEW}" != "${YARNLOCK_SHA256_OLD}" ]; then | ||
echo "yarn.lock has changed while updating @tonomy/tonomy-id-sdk@${VERSION}" | ||
echo "Please run \"yarn run installSdkVersion\" to fix" | ||
exit 1 | ||
fi | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters