@@ -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
0 commit comments