Compare commits

...
Author SHA1 Message Date
alvinfeiandCursor d0d8b4e163 fix(ci): locate nested Linux release artifacts
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-17 20:33:24 +08:00
2 changed files with 23 additions and 7 deletions

No files matched your search

+13 -7
View File
@@ -122,19 +122,25 @@ jobs:
shell: bash shell: bash
run: | run: |
set -euo pipefail set -euo pipefail
shopt -s globstar nullglob
version=$(node -p 'require("./package.json").version') version=$(node -p 'require("./package.json").version')
node scripts/verify-release-version.mjs \ node scripts/verify-release-version.mjs \
--channel stable \ --channel stable \
--version "$version" \ --version "$version" \
--build-number "$(node -p 'require("./package.json").release.build_number')" \ --build-number "$(node -p 'require("./package.json").release.build_number')" \
--tag "$GITHUB_REF_NAME" --tag "$GITHUB_REF_NAME"
mkdir -p publish-assets
for arch in x64 arm64; do for arch in x64 arm64; do
archive="release-assets/memhub-runtime-v${version}-linux-${arch}.tar.gz" name="memhub-runtime-v${version}-linux-${arch}.tar.gz"
test -f "$archive" archives=(release-assets/**/"$name")
test -f "$archive.sha256" checksums=(release-assets/**/"$name.sha256")
test "${#archives[@]}" -eq 1
test "${#checksums[@]}" -eq 1
cp -- "${archives[0]}" "publish-assets/$name"
cp -- "${checksums[0]}" "publish-assets/$name.sha256"
( (
cd release-assets cd publish-assets
sha256sum -c "$(basename "$archive.sha256")" sha256sum -c "$name.sha256"
) )
done done
- name: Upload Linux assets to a draft GitHub Release - name: Upload Linux assets to a draft GitHub Release
@@ -160,7 +166,7 @@ jobs:
--title "$GITHUB_REF_NAME" --title "$GITHUB_REF_NAME"
fi fi
gh release upload "$GITHUB_REF_NAME" \ gh release upload "$GITHUB_REF_NAME" \
release-assets/memhub-runtime-v*-linux-*.tar.gz \ publish-assets/memhub-runtime-v*-linux-*.tar.gz \
release-assets/memhub-runtime-v*-linux-*.tar.gz.sha256 \ publish-assets/memhub-runtime-v*-linux-*.tar.gz.sha256 \
--repo "$GITHUB_REPOSITORY" \ --repo "$GITHUB_REPOSITORY" \
--clobber --clobber
@@ -117,9 +117,19 @@ describe("Linux runtime scripts", () => {
workflow, workflow,
/verify-release-version\.mjs[\s\S]*--channel stable/, /verify-release-version\.mjs[\s\S]*--channel stable/,
); );
assert.match(workflow, /shopt -s globstar nullglob/);
assert.match(workflow, /archives=\(release-assets\/\*\*\/"\$name"\)/);
assert.match(
workflow,
/cp -- "\$\{archives\[0\]\}" "publish-assets\/\$name"/,
);
assert.match(workflow, /sha256sum -c/); assert.match(workflow, /sha256sum -c/);
assert.match(workflow, /--json isDraft[\s\S]*--jq \.isDraft/); assert.match(workflow, /--json isDraft[\s\S]*--jq \.isDraft/);
assert.match(workflow, /gh release create[\s\S]*--draft/); assert.match(workflow, /gh release create[\s\S]*--draft/);
assert.match(workflow, /gh release upload[\s\S]*--clobber/); assert.match(workflow, /gh release upload[\s\S]*--clobber/);
assert.match(
workflow,
/publish-assets\/memhub-runtime-v\*-linux-\*\.tar\.gz/,
);
}); });
}); });