diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a1b168cd..c9094117 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -6,7 +6,7 @@ jobs: build: strategy: matrix: - os: [windows-latest, ubuntu-latest, macos-latest] + os: [windows-latest, ubuntu-latest] runs-on: ${{ matrix.os }} @@ -38,22 +38,16 @@ jobs: MAIN_VITE_ONLINEFIX_PASSWORD: ${{ secrets.ONLINEFIX_PASSWORD }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Build Mac - if: matrix.os == 'macos-latest' - run: sudo yarn build:mac - env: - MAIN_VITE_ONLINEFIX_USERNAME: ${{ secrets.ONLINEFIX_USERNAME }} - MAIN_VITE_ONLINEFIX_PASSWORD: ${{ secrets.ONLINEFIX_PASSWORD }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Create artifact uses: actions/upload-artifact@v4 with: name: Build-${{ matrix.os }} path: | dist/win-unpacked/** + dist/*.zip dist/*.dmg dist/*.deb dist/*.rpm + dist/*.tar.gz dist/*.yml dist/*.blockmap diff --git a/postinstall.cjs b/postinstall.cjs index 555a27a6..2b793257 100644 --- a/postinstall.cjs +++ b/postinstall.cjs @@ -14,18 +14,25 @@ const downloadAria2 = async () => { process.platform === "win32" ? "aria2-1.37.0-win-64bit-build1.zip" : "aria2-1.37.0-1-x86_64.pkg.tar.zst"; + const downloadUrl = process.platform === "win32" ? `https://github.com/aria2/aria2/releases/download/release-1.37.0/${file}` : "https://archlinux.org/packages/extra/x86_64/aria2/download/"; + console.log(`Downloading ${file}...`); + const response = await axios.get(downloadUrl, { responseType: "stream" }); + const stream = response.data.pipe(fs.createWriteStream(file)); + stream.on("finish", async () => { console.log(`Downloaded ${file}, extracting...`); + if (process.platform === "win32") { await exec(`npx extract-zip ${file}`); console.log("Extracted. Renaming folder..."); + fs.renameSync(file.replace(".zip", ""), "aria2"); } else { await exec(`tar --zstd -xvf ${file} usr/bin/aria2c`); @@ -34,6 +41,7 @@ const downloadAria2 = async () => { fs.copyFileSync("usr/bin/aria2c", "aria2/aria2c"); fs.rmSync("usr", { recursive: true }); } + console.log(`Extracted ${file}, removing compressed downloaded file...`); fs.rmSync(file); });