Skip to content

Commit 424eb1d

Browse files
committed
Add Scoop bucket for Windows installation
1 parent 1cf2ed7 commit 424eb1d

4 files changed

Lines changed: 76 additions & 11 deletions

File tree

.github/workflows/release.yml

Lines changed: 36 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -204,8 +204,8 @@ jobs:
204204
205205
npm publish --provenance --access public
206206
207-
homebrew:
208-
name: Update Homebrew tap
207+
package-managers:
208+
name: Update Homebrew and Scoop
209209
needs: upload
210210
runs-on: ubuntu-latest
211211
steps:
@@ -221,19 +221,28 @@ jobs:
221221
run: |
222222
echo "VERSION=${GITHUB_REF_NAME#v}" >> $GITHUB_ENV
223223
224-
for target in aarch64-apple-darwin x86_64-apple-darwin aarch64-unknown-linux-gnu x86_64-unknown-linux-gnu; do
225-
sha=$(grep "no-v.*-${target}.tar.gz" checksums.txt | awk '{print $1}')
224+
for target in aarch64-apple-darwin x86_64-apple-darwin aarch64-unknown-linux-gnu x86_64-unknown-linux-gnu x86_64-pc-windows-msvc aarch64-pc-windows-msvc; do
225+
if [[ "$target" == *windows* ]]; then
226+
sha=$(grep "no-v.*-${target}.zip" checksums.txt | awk '{print $1}')
227+
else
228+
sha=$(grep "no-v.*-${target}.tar.gz" checksums.txt | awk '{print $1}')
229+
fi
226230
var_name=$(echo "$target" | tr '-' '_' | tr '[:lower:]' '[:upper:]')
227231
echo "SHA_${var_name}=${sha}" >> $GITHUB_ENV
228232
done
229233
230-
- name: Update Homebrew formula
234+
- name: Clone tap repo
231235
env:
232236
HOMEBREW_TAP_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }}
233237
run: |
234238
git clone "https://x-access-token:${HOMEBREW_TAP_TOKEN}@github.com/network-output/homebrew-tap.git" tap
235-
mkdir -p tap/Formula
239+
cd tap
240+
git config user.name "github-actions[bot]"
241+
git config user.email "github-actions[bot]@users.noreply.github.com"
236242
243+
- name: Update Homebrew formula
244+
run: |
245+
mkdir -p tap/Formula
237246
cp homebrew/Formula/network-output.rb tap/Formula/network-output.rb
238247
239248
cd tap
@@ -248,12 +257,29 @@ jobs:
248257
249258
for target in "${!SHA_MAP[@]}"; do
250259
sha="${SHA_MAP[$target]}"
251-
# Replace the PLACEHOLDER on the line following the URL for this target
252260
sed -i "/${target}/{ n; s/\"PLACEHOLDER\"/\"${sha}\"/ }" Formula/network-output.rb
253261
done
254262
255-
git config user.name "github-actions[bot]"
256-
git config user.email "github-actions[bot]@users.noreply.github.com"
257-
git add Formula/network-output.rb
263+
- name: Update Scoop manifest
264+
run: |
265+
mkdir -p tap/bucket
266+
cp scoop/no.json tap/bucket/no.json
267+
268+
cd tap
269+
node -e "
270+
const fs = require('fs');
271+
const m = JSON.parse(fs.readFileSync('bucket/no.json', 'utf8'));
272+
m.version = '$VERSION';
273+
m.architecture['64bit'].url = m.architecture['64bit'].url.replace(/v[0-9.]+/g, 'v$VERSION');
274+
m.architecture['64bit'].hash = '$SHA_X86_64_PC_WINDOWS_MSVC';
275+
m.architecture['arm64'].url = m.architecture['arm64'].url.replace(/v[0-9.]+/g, 'v$VERSION');
276+
m.architecture['arm64'].hash = '$SHA_AARCH64_PC_WINDOWS_MSVC';
277+
fs.writeFileSync('bucket/no.json', JSON.stringify(m, null, 2) + '\n');
278+
"
279+
280+
- name: Push updates
281+
working-directory: tap
282+
run: |
283+
git add Formula/network-output.rb bucket/no.json
258284
git commit -m "Update network-output to $VERSION"
259285
git push

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ homepage = "https://network-output.com"
1111
readme = "README.md"
1212
keywords = ["cli", "http", "json", "networking", "websocket"]
1313
categories = ["command-line-utilities", "network-programming"]
14-
exclude = [".github/", ".claude/", "justfile", "AGENTS.md", "npm/", "homebrew/"]
14+
exclude = [".github/", ".claude/", "justfile", "AGENTS.md", "npm/", "homebrew/", "scoop/"]
1515

1616
[[bin]]
1717
name = "no"

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,13 @@ For a permanent install:
3030
npm install -g @network-output/no
3131
```
3232

33+
### Scoop (Windows)
34+
35+
```sh
36+
scoop bucket add network-output https://github.com/network-output/homebrew-tap
37+
scoop install no
38+
```
39+
3340
### GitHub Releases
3441

3542
Download prebuilt binaries from [GitHub Releases](https://github.com/network-output/no/releases).

scoop/no.json

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"version": "0.1.2",
3+
"description": "Fast, structured networking CLI for HTTP, WS, TCP, UDP, DNS, Ping, WHOIS, MQTT, SSE",
4+
"homepage": "https://network-output.com",
5+
"license": "Apache-2.0",
6+
"architecture": {
7+
"64bit": {
8+
"url": "https://github.com/network-output/no/releases/download/v0.1.2/no-v0.1.2-x86_64-pc-windows-msvc.zip",
9+
"hash": "PLACEHOLDER"
10+
},
11+
"arm64": {
12+
"url": "https://github.com/network-output/no/releases/download/v0.1.2/no-v0.1.2-aarch64-pc-windows-msvc.zip",
13+
"hash": "PLACEHOLDER"
14+
}
15+
},
16+
"bin": "no.exe",
17+
"checkver": "github",
18+
"autoupdate": {
19+
"architecture": {
20+
"64bit": {
21+
"url": "https://github.com/network-output/no/releases/download/v$version/no-v$version-x86_64-pc-windows-msvc.zip"
22+
},
23+
"arm64": {
24+
"url": "https://github.com/network-output/no/releases/download/v$version/no-v$version-aarch64-pc-windows-msvc.zip"
25+
}
26+
},
27+
"hash": {
28+
"url": "$url.sha256",
29+
"regex": "^([a-f0-9]+)"
30+
}
31+
}
32+
}

0 commit comments

Comments
 (0)