mirror of
https://github.com/hydralauncher/hydra.git
synced 2026-01-11 13:56:16 +00:00
feat: upgrading ludusavi
This commit is contained in:
12
.github/workflows/release.yml
vendored
12
.github/workflows/release.yml
vendored
@@ -88,6 +88,18 @@ jobs:
|
|||||||
dist/*.blockmap
|
dist/*.blockmap
|
||||||
dist/*.pacman
|
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
|
- name: Release
|
||||||
uses: softprops/action-gh-release@v2
|
uses: softprops/action-gh-release@v2
|
||||||
with:
|
with:
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
const { default: axios } = require("axios");
|
const { default: axios } = require("axios");
|
||||||
|
const tar = require("tar");
|
||||||
const util = require("node:util");
|
const util = require("node:util");
|
||||||
const fs = require("node:fs");
|
const fs = require("node:fs");
|
||||||
const path = require("node:path");
|
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 exec = util.promisify(require("node:child_process").exec);
|
||||||
|
|
||||||
|
const ludusaviVersion = "0.29.0";
|
||||||
|
|
||||||
const fileName = {
|
const fileName = {
|
||||||
win32: "ludusavi-v0.25.0-win64.zip",
|
win32: `ludusavi-v${ludusaviVersion}-win64.tar.gz`,
|
||||||
linux: "ludusavi-v0.25.0-linux.zip",
|
linux: `ludusavi-v${ludusaviVersion}-linux.tar.gz`,
|
||||||
darwin: "ludusavi-v0.25.0-mac.zip",
|
darwin: `ludusavi-v${ludusaviVersion}-mac.tar.gz`,
|
||||||
};
|
};
|
||||||
|
|
||||||
const downloadLudusavi = async () => {
|
const downloadLudusavi = async () => {
|
||||||
@@ -19,7 +22,7 @@ const downloadLudusavi = async () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const file = fileName[process.platform];
|
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}...`);
|
console.log(`Downloading ${file}...`);
|
||||||
|
|
||||||
@@ -34,7 +37,12 @@ const downloadLudusavi = async () => {
|
|||||||
|
|
||||||
const targetPath = path.join(pwd, "ludusavi");
|
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") {
|
if (process.platform !== "win32") {
|
||||||
fs.chmodSync(path.join(targetPath, "ludusavi"), 0o755);
|
fs.chmodSync(path.join(targetPath, "ludusavi"), 0o755);
|
||||||
|
|||||||
Reference in New Issue
Block a user