diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 51dcd506..d7098e44 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -88,6 +88,18 @@ jobs: dist/*.blockmap dist/*.pacman + - name: Upload build + env: + BRANCH_NAME: ${{ github.head_ref || github.ref_name }} + S3_ENDPOINT: ${{ secrets.S3_ENDPOINT }} + S3_ACCESS_KEY_ID: ${{ secrets.S3_ACCESS_KEY_ID }} + S3_SECRET_ACCESS_KEY: ${{ secrets.S3_SECRET_ACCESS_KEY }} + S3_BUILDS_BUCKET_NAME: ${{ secrets.S3_BUILDS_BUCKET_NAME }} + BUILDS_URL: ${{ secrets.BUILDS_URL }} + BUILD_WEBHOOK_URL: ${{ secrets.BUILD_WEBHOOK_URL }} + GITHUB_ACTOR: ${{ github.actor }} + run: node scripts/upload-build.cjs + - name: Release uses: softprops/action-gh-release@v2 with: diff --git a/scripts/postinstall.cjs b/scripts/postinstall.cjs index fc3f69dd..bf30407e 100644 --- a/scripts/postinstall.cjs +++ b/scripts/postinstall.cjs @@ -1,4 +1,5 @@ const { default: axios } = require("axios"); +const tar = require("tar"); const util = require("node:util"); const fs = require("node:fs"); const path = require("node:path"); @@ -6,10 +7,12 @@ const { spawnSync } = require("node:child_process"); const exec = util.promisify(require("node:child_process").exec); +const ludusaviVersion = "0.29.0"; + const fileName = { - win32: "ludusavi-v0.25.0-win64.zip", - linux: "ludusavi-v0.25.0-linux.zip", - darwin: "ludusavi-v0.25.0-mac.zip", + win32: `ludusavi-v${ludusaviVersion}-win64.tar.gz`, + linux: `ludusavi-v${ludusaviVersion}-linux.tar.gz`, + darwin: `ludusavi-v${ludusaviVersion}-mac.tar.gz`, }; const downloadLudusavi = async () => { @@ -19,7 +22,7 @@ const downloadLudusavi = async () => { } const file = fileName[process.platform]; - const downloadUrl = `https://github.com/mtkennerly/ludusavi/releases/download/v0.25.0/${file}`; + const downloadUrl = `https://github.com/mtkennerly/ludusavi/releases/download/v${ludusaviVersion}/${file}`; console.log(`Downloading ${file}...`); @@ -34,7 +37,12 @@ const downloadLudusavi = async () => { const targetPath = path.join(pwd, "ludusavi"); - await exec(`npx extract-zip ${file} ${targetPath}`); + await fs.promises.mkdir(targetPath, { recursive: true }); + + await tar.x({ + file: file, + cwd: targetPath, + }); if (process.platform !== "win32") { fs.chmodSync(path.join(targetPath, "ludusavi"), 0o755);