From 06b76274122d5067dbe0af4ab01308f60dc7d169 Mon Sep 17 00:00:00 2001 From: coyotte508 Date: Fri, 18 Oct 2024 14:58:35 +0200 Subject: [PATCH 1/2] fix CI --- .github/workflows/tasks-publish.yml | 38 +++++++++++++++++++++++++++++ .github/workflows/test.yml | 2 +- 2 files changed, 39 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tasks-publish.yml b/.github/workflows/tasks-publish.yml index e4ec47dc8..dbee121ea 100644 --- a/.github/workflows/tasks-publish.yml +++ b/.github/workflows/tasks-publish.yml @@ -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 }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 99fa2469d..eea042652 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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 From bfb2b816c674c5ca6c16f546872ed2066078354e Mon Sep 17 00:00:00 2001 From: coyotte508 Date: Fri, 18 Oct 2024 15:22:52 +0200 Subject: [PATCH 2/2] fix deno? --- e2e/deno/deno.json | 1 + e2e/mock-registry-config.yaml | 3 +++ 2 files changed, 4 insertions(+) create mode 100644 e2e/deno/deno.json diff --git a/e2e/deno/deno.json b/e2e/deno/deno.json new file mode 100644 index 000000000..0967ef424 --- /dev/null +++ b/e2e/deno/deno.json @@ -0,0 +1 @@ +{} diff --git a/e2e/mock-registry-config.yaml b/e2e/mock-registry-config.yaml index 4a8607524..16150ced9 100644 --- a/e2e/mock-registry-config.yaml +++ b/e2e/mock-registry-config.yaml @@ -4,6 +4,9 @@ auth: foo: name: test password: test +web: + # login with foo / test + enable: true store: memory: limit: 1000