From 121f344f84096b044b03f1b97e8ce61d60b812c3 Mon Sep 17 00:00:00 2001 From: Oj Date: Tue, 12 Apr 2022 21:40:32 +0100 Subject: [PATCH] [CI > Win] v1 --- .github/workflows/nightly.yml | 43 ++++++++++++++++++++--------------- 1 file changed, 25 insertions(+), 18 deletions(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 9ec7edf..fba1f76 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -80,32 +80,39 @@ jobs: steps: - uses: actions/checkout@v2 + - name: Setup Node.js v16.x + uses: actions/setup-node@v2 + with: + node-version: 16.x + - name: Retrieve artifact uses: actions/download-artifact@v2 with: name: built-asar path: artifact - - - name: Setup tmate session - uses: mxschmitt/action-tmate@v3 - # - name: Extract artifact - # run: | - # cp artifact/app.asar . + - name: Extract artifact + run: | + cp artifact/app.asar . - # - name: Download Client with OpenAsar - # run: | - # wget "https://discord.com/api/download/canary?platform=linux&format=tar.gz" -O discord.tar.gz - # tar xf discord.tar.gz - # cp app.asar DiscordCanary/resources/app.asar + - name: Setup Client + run: | + # Download latest client from updater v2 and extract (manifest -> brotli -> tar) + wget "$(curl https://discord.com/api/updates/distributions/app/manifests/latest\?channel\=canary\&platform\=win\&arch\=x86 | python -c 'import json,sys;print(json.load(sys.stdin)["full"]["url"])')" + node -e "fs.writeFileSync('full.tar', zlib.brotliDecompressSync(fs.readFileSync('full.distro')))" + tar xf full.tar - # - name: Check if Discord will startup - # run: | - # coproc { xvfb-run -e /dev/stdout ./DiscordCanary/DiscordCanary --enable-logging; } - # grep -m1 "Installing discord_rpc" <&${COPROC[0]} - # sleep 1 - # [[ $COPROC_PID ]] && kill $COPROC_PID - # timeout-minutes: 3 + # Install OpenAsar build and setup environment + sed -i "s/^\/\/ .*$/if \(name == 'discord_rpc'\) { console.log\('ABRA'\); process.exit\(\); }/" app.asar + cp -f app.asar files/resources/app.asar + mkdir discord + cp -rf files/ discord/app-1.0.0 + cd discord/app-1.0.0 + + - name: Check if Discord will startup + run: | + ./DiscordCanary.exe | grep -m1 "ABRA" + timeout-minutes: 3 release: