Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
26 changes: 18 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,15 +125,25 @@ jobs:
- name: Download all artifacts
uses: actions/download-artifact@v4

- name: Create release
- name: Create or update release
env:
GH_TOKEN: ${{ github.token }}
TAG_NAME: ${{ github.ref_name }}
run: |
gh release create "$TAG_NAME" \
macos-arm64/wick-darwin-arm64.tar.gz \
macos-arm64/wick-captcha-darwin-arm64.tar.gz \
linux-amd64/wick-linux-amd64.tar.gz \
linux-amd64/wick-linux-amd64.deb \
--title "$TAG_NAME" \
--generate-notes
if gh release view "$TAG_NAME" > /dev/null 2>&1; then
echo "Release $TAG_NAME exists, uploading assets..."
gh release upload "$TAG_NAME" --clobber \
macos-arm64/wick-darwin-arm64.tar.gz \
macos-arm64/wick-captcha-darwin-arm64.tar.gz \
linux-amd64/wick-linux-amd64.tar.gz \
linux-amd64/wick-linux-amd64.deb
else
echo "Creating release $TAG_NAME..."
gh release create "$TAG_NAME" \
macos-arm64/wick-darwin-arm64.tar.gz \
macos-arm64/wick-captcha-darwin-arm64.tar.gz \
linux-amd64/wick-linux-amd64.tar.gz \
linux-amd64/wick-linux-amd64.deb \
--title "$TAG_NAME" \
--generate-notes
fi
4 changes: 2 additions & 2 deletions npm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
"scripts": {
"postinstall": "node scripts/install.js"
},
"os": ["darwin"],
"cpu": ["arm64"],
"os": ["darwin", "linux"],
"cpu": ["arm64", "x64"],
"files": [
"bin/",
"scripts/",
Expand Down
19 changes: 19 additions & 0 deletions npm/scripts/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ const ASSETS = {
url: `https://github.com/wickproject/wick/releases/download/v${VERSION}/wick-${VERSION}-darwin-arm64.tar.gz`,
sha256: "766f48f0eb1cfb220352f9fb266fb97504fe456cea9670a1d1f3516b3ae8f725",
},
"linux-x64": {
url: `https://github.com/wickproject/wick/releases/download/v${VERSION}/wick-linux-amd64.tar.gz`,
sha256: "110d074072ff5fb334ca3d0123def3f9463d5298f9c6a48fa727a03d21f08ea9",
hasLib: true,
},
};

const asset = ASSETS[PLATFORM];
Expand Down Expand Up @@ -61,6 +66,20 @@ async function main() {
execFileSync("tar", ["xzf", tarPath, "-C", binDir]);
fs.unlinkSync(tarPath);
fs.chmodSync(binPath, 0o755);

// On Linux, the tarball includes libcronet.so — create a wrapper script
// so LD_LIBRARY_PATH is set automatically
const libPath = path.join(binDir, "libcronet.so");
if (asset.hasLib && fs.existsSync(libPath)) {
const realBin = path.join(binDir, "wick-bin");
fs.renameSync(binPath, realBin);
fs.writeFileSync(
binPath,
`#!/bin/sh\nLD_LIBRARY_PATH="${binDir}:$LD_LIBRARY_PATH" exec "${realBin}" "$@"\n`
);
fs.chmodSync(binPath, 0o755);
}

console.log("Wick installed successfully.");
}

Expand Down
Loading