Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix CI #972

Merged
merged 2 commits into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .github/workflows/tasks-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,44 @@ jobs:
node -e "const fs = require('fs'); const package = JSON.parse(fs.readFileSync('./package.json')); package.version = '$BUMPED_VERSION'; fs.writeFileSync('./package.json', JSON.stringify(package, null, '\t') + '\n');"
git commit . -m "🔖 @huggingface/tasks $BUMPED_VERSION"
git tag "tasks-v$BUMPED_VERSION"

- name: Make sure that the latest version of @huggingface/gguf is consistent with the local version
run: |
LOCAL_GGUF_VERSION=$(node -p "require('./package.json').version")
REMOTE_GGUF_VERSION=$(npm view @huggingface/gguf version)

# If the versions are different, error
if [ "$LOCAL_GGUF_VERSION" != "$REMOTE_GGUF_VERSION" ]; then
echo "Error: The local @huggingface/gguf package version ($LOCAL_GGUF_VERSION) differs from the remote version ($REMOTE_GGUF_VERSION). Release halted."
exit 1
fi

npm pack @huggingface/gguf
mv huggingface-gguf-$LOCAL_GGUF_VERSION.tgz gguf-local.tgz

npm pack @huggingface/gguf@$REMOTE_GGUF_VERSION
mv huggingface-gguf-$REMOTE_GGUF_VERSION.tgz gguf-remote.tgz

# Compute checksum of local tar. We need to extract both tar since the remote compression might be different
tar -xf gguf-local.tgz
LOCAL_CHECKSUM=$(cd package && tar --mtime='1970-01-01' --mode=755 -cf - . | sha256sum | cut -d' ' -f1)
echo "Local package checksum: $LOCAL_CHECKSUM"

rm -Rf package

tar -xf gguf-remote.tgz
REMOTE_CHECKSUM=$(cd package && tar --mtime='1970-01-01' --mode=755 -cf - . | sha256sum | cut -d' ' -f1)
echo "Remote package checksum: $REMOTE_CHECKSUM"

rm -Rf package

if [ "$LOCAL_CHECKSUM" != "$REMOTE_CHECKSUM" ]; then
echo "Checksum Verification Failed: The local @huggingface/gguf package differs from the remote version. Release halted. Local Checksum: $LOCAL_CHECKSUM, Remote Checksum: $REMOTE_CHECKSUM"
exit 1
fi
echo "Checksum Verification Successful: The local and remote @huggingface/gguf packages are consistent. Proceeding with the @huggingface/widgets package release. Local Checksum: $LOCAL_CHECKSUM, Remote Checksum: $REMOTE_CHECKSUM."
working-directory: packages/gguf

- run: pnpm publish --no-git-checks .
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ jobs:
run: |
sleep 3
pnpm i --filter root --filter inference... --filter hub... --frozen-lockfile
pnpm --filter inference --filter hub --filter tasks publish --force --no-git-checks --registry http://localhost:4874/
pnpm --filter inference --filter hub --filter tasks --filter gguf publish --force --no-git-checks --registry http://localhost:4874/

- name: E2E test - test yarn install
working-directory: e2e/ts
Expand Down
Loading