Skip to content

Commit

Permalink
undo build pipeline changes
Browse files Browse the repository at this point in the history
  • Loading branch information
zamitto committed Jun 7, 2024
1 parent f5055c4 commit b51b185
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
12 changes: 3 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
build:
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
os: [windows-latest, ubuntu-latest]

runs-on: ${{ matrix.os }}

Expand Down Expand Up @@ -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
8 changes: 8 additions & 0 deletions postinstall.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -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`);
Expand All @@ -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);
});
Expand Down

0 comments on commit b51b185

Please sign in to comment.