|
52 | 52 | git add ../.. |
53 | 53 | git commit -m "🔖 @hugginface/hub $BUMPED_VERSION" |
54 | 54 | git tag "hub-v$BUMPED_VERSION" |
| 55 | +
|
| 56 | + - name: Make sure that the latest version of @huggingface/tasks is consistent with the local version |
| 57 | + run: | |
| 58 | + LOCAL_TASKS_VERSION=$(node -p "require('./package.json').version") |
| 59 | + REMOTE_TASKS_VERSION=$(npm view @huggingface/tasks version) |
| 60 | +
|
| 61 | + # If the versions are different, error |
| 62 | + if [ "$LOCAL_TASKS_VERSION" != "$REMOTE_TASKS_VERSION" ]; then |
| 63 | + echo "Error: The local @huggingface/tasks package version ($LOCAL_TASKS_VERSION) differs from the remote version ($REMOTE_TASKS_VERSION). Release halted." |
| 64 | + exit 1 |
| 65 | + fi |
| 66 | +
|
| 67 | + npm pack @huggingface/tasks |
| 68 | + mv huggingface-tasks-$LOCAL_TASKS_VERSION.tgz tasks-local.tgz |
| 69 | +
|
| 70 | + npm pack @huggingface/tasks@$REMOTE_TASKS_VERSION |
| 71 | + mv huggingface-tasks-$REMOTE_TASKS_VERSION.tgz tasks-remote.tgz |
| 72 | +
|
| 73 | + # Compute checksum of local tar. We need to extract both tar since the remote compression might be different |
| 74 | + tar -xf tasks-local.tgz |
| 75 | + LOCAL_CHECKSUM=$(cd package && tar --mtime='1970-01-01' --mode=755 -cf - . | sha256sum | cut -d' ' -f1) |
| 76 | + echo "Local package checksum: $LOCAL_CHECKSUM" |
| 77 | +
|
| 78 | + rm -Rf package |
| 79 | +
|
| 80 | + tar -xf tasks-remote.tgz |
| 81 | + REMOTE_CHECKSUM=$(cd package && tar --mtime='1970-01-01' --mode=755 -cf - . | sha256sum | cut -d' ' -f1) |
| 82 | + echo "Remote package checksum: $REMOTE_CHECKSUM" |
| 83 | +
|
| 84 | + rm -Rf package |
| 85 | +
|
| 86 | + if [ "$LOCAL_CHECKSUM" != "$REMOTE_CHECKSUM" ]; then |
| 87 | + echo "Checksum Verification Failed: The local @huggingface/tasks package differs from the remote version. Release halted. Local Checksum: $LOCAL_CHECKSUM, Remote Checksum: $REMOTE_CHECKSUM" |
| 88 | + exit 1 |
| 89 | + fi |
| 90 | + echo "Checksum Verification Successful: The local and remote @huggingface/tasks packages are consistent. Proceeding with the @huggingface/widgets package release. Local Checksum: $LOCAL_CHECKSUM, Remote Checksum: $REMOTE_CHECKSUM." |
| 91 | + working-directory: packages/tasks |
| 92 | + |
55 | 93 | - run: pnpm publish --no-git-checks . |
56 | 94 | env: |
57 | 95 | NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
|
0 commit comments