|
87 | 87 | 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."
|
88 | 88 | working-directory: packages/tasks
|
89 | 89 |
|
| 90 | + - name: Make sure that the latest version of @huggingface/jinja is consistent with the local version |
| 91 | + run: | |
| 92 | + LOCAL_JINJA_VERSION=$(node -p "require('./package.json').version") |
| 93 | + REMOTE_JINJA_VERSION=$(npm view @huggingface/jinja version) |
| 94 | +
|
| 95 | + # If the versions are different, error |
| 96 | + if [ "$LOCAL_JINJA_VERSION" != "$REMOTE_JINJA_VERSION" ]; then |
| 97 | + echo "Error: The local @huggingface/jinja package version ($LOCAL_JINJA_VERSION) differs from the remote version ($REMOTE_JINJA_VERSION). Release halted." |
| 98 | + exit 1 |
| 99 | + fi |
| 100 | +
|
| 101 | + npm pack @huggingface/jinja |
| 102 | + mv huggingface-jinja-$LOCAL_JINJA_VERSION.tgz jinja-local.tgz |
| 103 | +
|
| 104 | + npm pack @huggingface/jinja@$REMOTE_JINJA_VERSION |
| 105 | + mv huggingface-jinja-$REMOTE_JINJA_VERSION.tgz jinja-remote.tgz |
| 106 | +
|
| 107 | + # Compute checksum of local tar. We need to extract both tar since the remote compression might be different |
| 108 | + tar -xf jinja-local.tgz |
| 109 | + LOCAL_CHECKSUM=$(cd package && tar --mtime='1970-01-01' --mode=755 -cf - . | sha256sum | cut -d' ' -f1) |
| 110 | + echo "Local package checksum: $LOCAL_CHECKSUM" |
| 111 | +
|
| 112 | + rm -Rf package |
| 113 | +
|
| 114 | + tar -xf jinja-remote.tgz |
| 115 | + REMOTE_CHECKSUM=$(cd package && tar --mtime='1970-01-01' --mode=755 -cf - . | sha256sum | cut -d' ' -f1) |
| 116 | + echo "Remote package checksum: $REMOTE_CHECKSUM" |
| 117 | +
|
| 118 | + rm -Rf package |
| 119 | +
|
| 120 | + if [ "$LOCAL_CHECKSUM" != "$REMOTE_CHECKSUM" ]; then |
| 121 | + echo "Checksum Verification Failed: The local @huggingface/jinja package differs from the remote version. Release halted. Local Checksum: $LOCAL_CHECKSUM, Remote Checksum: $REMOTE_CHECKSUM" |
| 122 | + exit 1 |
| 123 | + fi |
| 124 | + echo "Checksum Verification Successful: The local and remote @huggingface/jinja packages are consistent. Proceeding with the @huggingface/widgets package release. Local Checksum: $LOCAL_CHECKSUM, Remote Checksum: $REMOTE_CHECKSUM." |
| 125 | + working-directory: packages/jinja |
| 126 | + |
90 | 127 | - run: pnpm publish --no-git-checks .
|
91 | 128 | env:
|
92 | 129 | NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
0 commit comments