diff options
| author | OmniTroid <davidskoland@gmail.com> | 2024-07-01 18:00:23 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-07-01 18:00:23 +0200 |
| commit | 36345612d7f5bd03dfbc63fbc38933109486ecc4 (patch) | |
| tree | 7cede8e691c65da0100b3eb83756290b2f6e672a /scripts | |
| parent | 2b970ec4a315fa22f07105fffce305480de11fb6 (diff) | |
Readme and script cleanup (#995)
* Ignore .idea
* Ignore build dir too
* Remove unused Windows Docker files
* Remove somewhat cryptic launch.sh script
* Remove kebab (javascript)
* Remove outdated release_macos script and rename the most up-to-date one to macos_release
* Clean up README.md and delete the other ones
* Add preliminary configure script
* Add hint in dependencies
* Remove obsolete CONTRIBUTING.md
* let's write the configure script later
* Adding this is so supremely ironic that I can't even
* Update QtApng repo
* Actually we needed that
* Add comment
* Contact should be h2
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/launch.sh | 4 | ||||
| -rw-r--r--[-rwxr-xr-x] | scripts/macos_release.sh (renamed from scripts/macos_post_build.sh) | 0 | ||||
| -rw-r--r-- | scripts/package.json | 9 | ||||
| -rwxr-xr-x | scripts/release_macos.sh | 22 | ||||
| -rwxr-xr-x | scripts/update_manifest.js | 149 | ||||
| -rwxr-xr-x | scripts/update_program_manifest.js | 39 | ||||
| -rw-r--r-- | scripts/windows/Dockerfile | 26 | ||||
| -rw-r--r-- | scripts/windows/Dockerfile-mxe | 44 | ||||
| -rw-r--r-- | scripts/windows/how-to-push.md | 19 |
9 files changed, 3 insertions, 309 deletions
diff --git a/scripts/launch.sh b/scripts/launch.sh index 7846ef78..dcf6e7af 100644 --- a/scripts/launch.sh +++ b/scripts/launch.sh @@ -1,3 +1,5 @@ #!/bin/sh + +# Required in CI to launch correctly chmod +x Attorney_Online -LD_LIBRARY_PATH=. ./Attorney_Online
\ No newline at end of file +LD_LIBRARY_PATH=. ./Attorney_Online diff --git a/scripts/macos_post_build.sh b/scripts/macos_release.sh index 2ed73649..2ed73649 100755..100644 --- a/scripts/macos_post_build.sh +++ b/scripts/macos_release.sh diff --git a/scripts/package.json b/scripts/package.json deleted file mode 100644 index 126a3920..00000000 --- a/scripts/package.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "ao-ci-scripts", - "version": "1.0.0", - "main": "update_manifest.js", - "dependencies": { - "argparse": "^1.0.10" - }, - "license": "ISC" -} diff --git a/scripts/release_macos.sh b/scripts/release_macos.sh deleted file mode 100755 index 50acb408..00000000 --- a/scripts/release_macos.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/sh - -# This script prepares the compiled bundle for shipping as a standalone release -# Assumes the Qt bin folder is in PATH -# Should be used on a "Release" build from QT creator -# Note that this DOES NOT add the base/ folder - -# Exit on errors and unset variables -set -eu - -ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/" - -cd ${ROOT_DIR} - -# This thing basically does all the work -macdeployqt ../bin/Attorney_Online.app - -# Need to add the dependencies -cp ../lib/* ../bin/Attorney_Online.app/Contents/Frameworks - -# libbass has a funny path for some reason, just use rpath -install_name_tool -change @loader_path/libbass.dylib @rpath/libbass.dylib ../bin/Attorney_Online.app/Contents/MacOS/Attorney_Online diff --git a/scripts/update_manifest.js b/scripts/update_manifest.js deleted file mode 100755 index bbd2a5f4..00000000 --- a/scripts/update_manifest.js +++ /dev/null @@ -1,149 +0,0 @@ -#!/usr/bin/env node - -const fs = require("fs"); -const crypto = require("crypto"); -const path = require("path"); -const ArgumentParser = require("argparse").ArgumentParser; - -function isFile(file) { - if (!fs.existsSync(file)) { - console.error(`File '${file}' not found. Try again.`); - throw Error(); - } - return file; -} - -const argParser = new ArgumentParser({ - addHelp: true, - description: "Adds a new latest version to the manifest file based on the " + - "provided zip file, including an incremental update." -}); -argParser.addArgument("manifestFile", { - metavar: "<manifest file>", type: isFile -}); -argParser.addArgument("version", { - metavar: "<version>" -}); -argParser.addArgument([ "-f", "--full" ], { - metavar: "<full zip file>", type: isFile, nargs: 1, - dest: "fullZipFileArgs" -}); -argParser.addArgument([ "-i", "--incremental" ], { - type: isFile, nargs: 2, dest: "incrementalArgs", - metavar: ["<incremental zip file>", "<file containing list of changed files>"] -}); -argParser.addArgument([ "-e", "--executable" ], { - metavar: "[executable file]", nargs: 1, - dest: "executableArgs" -}); - -const { - manifestFile, - version, - fullZipFileArgs, - incrementalArgs, - executableArgs -} = argParser.parseArgs(); - -const [incrementalZipFile, changesFile] = incrementalArgs || []; -const [fullZipFile] = fullZipFileArgs || []; -const [executable] = executableArgs || []; - -// Do one final check -if (!incrementalZipFile && !fullZipFile) { - console.error("No download archive specified! Abort."); - process.exit(1); -} - -// Do a quick litmus test to prevent deleting everything incorrectly -if (changesFile && !fs.existsSync("base")) { - console.error("The working directory must be set to an " + - "asset folder in order for deleted directories " + - "to be calculated correctly. Abort."); - process.exit(1); -} - -const manifest = JSON.parse(fs.readFileSync(manifestFile)); - -const dirsDeleted = new Set(); -const specialActions = changesFile ? - fs.readFileSync(changesFile) - .toString() - .trim() - .split("\n") - .map(line => line.split("\t")) - .map(([mode, target, source]) => { - switch (mode[0]) { - case "D": // Deleted - // Check if the folder exists relative to the working - // directory, and if not, add it to the dirsDeleted list. - // Keep going up the tree to see how many directories were - // deleted. - let dir = path.dirname(target); - while (!dirsDeleted.has(dir) && !fs.existsSync(dir)) { - dirsDeleted.add(dir); - dir = path.dirname(dir); - } - - return { action: "delete", target }; - case "R": // Renamed - // NOTE: Make sure that the launcher's implementation of - // the move action also creates directories when needed. - return { action: "move", source, target}; - default: - return null; - } - }) - // Remove ignored file mode changes - .filter(action => action !== null) - // Create actions based on directories to be deleted. - // Always have deeper directories first, to guarantee that deleting - // higher-level directories will succeed. - .concat(Array.from(dirsDeleted.values()) - .sort((a, b) => b.split("/").length - a.split("/").length) - .map(dir => ({ action: "deleteDir", target: dir }))) - : []; - -const urlBase = "https://s3.wasabisys.com/ao-downloads/"; - -const versionEntry = { - version, - executable, - prev: manifest.versions[0] ? manifest.versions[0].version : undefined, - full: fullZipFile ? [ - { - action: "dl", - url: urlBase + encodeURIComponent(path.basename(fullZipFile)), - hash: crypto.createHash("sha1") - .update(fs.readFileSync(fullZipFile)) - .digest("hex") - } - ] : undefined, - update: incrementalArgs ? [ - ...specialActions, - { - action: "dl", - url: urlBase + encodeURIComponent(path.basename(incrementalZipFile)), - hash: crypto.createHash("sha1") - .update(fs.readFileSync(incrementalZipFile)) - .digest("hex") - } - ] : undefined -}; - -console.log("Generated version entry:", versionEntry); - -const existingVersions = manifest.versions.filter(v => v.version == version); -if (existingVersions.length > 0) { - console.warn(`Warning: version ${version} already exists. Adding new values.`); - - // Don't overwrite prev - it will cause headaches - delete versionEntry.prev; - - Object.assign(existingVersions[0], versionEntry); - console.log("Merged version entry:", existingVersions[0]); -} else { - manifest.versions = [versionEntry, ...manifest.versions]; -} - -fs.writeFileSync(manifestFile, JSON.stringify(manifest, null, 4)); diff --git a/scripts/update_program_manifest.js b/scripts/update_program_manifest.js deleted file mode 100755 index 9efc814f..00000000 --- a/scripts/update_program_manifest.js +++ /dev/null @@ -1,39 +0,0 @@ -#!/usr/bin/env node - -const fs = require("fs"); -const crypto = require("crypto"); - -const [ _nodeExe, _jsPath, manifestFile, version, zipFile ] = process.argv; - -if (!manifestFile || !version || !zipFile) { - console.log(`Usage: update_program_manifest <manifest file> <version> <zip file>`); - console.log(`Adds a new latest version to the manifest file based on the ` + - `provided zip file.`); - process.exit(1); -} - -if (!fs.existsSync(manifestFile)) { - console.error(`Manifest file '${manifestFile}' not found. Try again.`); - process.exit(2); -} - -if (!fs.existsSync(zipFile)) { - console.error(`Zip file '${zipFile}' not found. Try again.`); - process.exit(2); -} - -const manifest = JSON.parse(fs.readFileSync(manifestFile)); - -manifest.versions = [{ - version, - executable: "Attorney_Online.exe", - full: [ - { - action: "dl", - url: "https://s3.wasabisys.com/ao-downloads/" + encodeURIComponent(zipFile), - hash: crypto.createHash("sha1").update(fs.readFileSync(zipFile)).digest("hex") - } - ] -}, ...manifest.versions]; - -fs.writeFileSync(manifestFile, JSON.stringify(manifest, null, 4));
\ No newline at end of file diff --git a/scripts/windows/Dockerfile b/scripts/windows/Dockerfile deleted file mode 100644 index 9d3cca06..00000000 --- a/scripts/windows/Dockerfile +++ /dev/null @@ -1,26 +0,0 @@ -FROM oldmud0/mxe-qt:5.13.0-win32-static-posix -#FROM fffaraz/qt:windows - -ENV TARGET_SPEC i686-w64-mingw32.static.posix - -# Build libarchive statically -WORKDIR /opt/mxe -RUN make -j4 MXE_TARGETS=${TARGET_SPEC} libarchive bzip2 xz lz4 zstd nettle expat libxml2 -WORKDIR / - -# Build Discord RPC statically -RUN git clone https://github.com/discordapp/discord-rpc -WORKDIR discord-rpc/build -RUN /opt/mxe/usr/bin/${TARGET_SPEC}-cmake .. -DCMAKE_INSTALL_PREFIX=/opt/mxe/usr/${TARGET_SPEC} -RUN /opt/mxe/usr/bin/${TARGET_SPEC}-cmake --build . --config Release --target install -WORKDIR ../.. - -# Build QtApng statically -RUN git clone https://github.com/Skycoder42/QtApng -WORKDIR QtApng -# libpng contains a self-test entry point that takes precedence for some reason -# over the final build's entry point. -RUN sed -i "s/^main(/libpng_main(/g" src/3rdparty/libpng/src/pngtest.c -RUN /opt/mxe/usr/${TARGET_SPEC}/qt5/bin/qmake -RUN make && make install -WORKDIR ..
\ No newline at end of file diff --git a/scripts/windows/Dockerfile-mxe b/scripts/windows/Dockerfile-mxe deleted file mode 100644 index 873e1442..00000000 --- a/scripts/windows/Dockerfile-mxe +++ /dev/null @@ -1,44 +0,0 @@ -FROM ubuntu:18.04 - -RUN apt-get update -RUN apt-get install -y \ - autoconf \ - automake \ - autopoint \ - bash \ - bison \ - bzip2 \ - flex \ - g++ \ - g++-multilib \ - gettext \ - git \ - gperf \ - intltool \ - libc6-dev-i386 \ - libgdk-pixbuf2.0-dev \ - libltdl-dev \ - libssl-dev \ - libtool-bin \ - libxml-parser-perl \ - lzip \ - make \ - openssl \ - p7zip-full \ - patch \ - perl \ - pkg-config \ - python \ - ruby \ - sed \ - unzip \ - wget \ - xz-utils - -RUN git clone https://github.com/mxe/mxe.git -RUN mv mxe /opt/mxe -WORKDIR /opt/mxe -RUN make -j4 MXE_TARGETS="i686-w64-mingw32.static.posix" qtbase qtmultimedia libarchive -ENV PATH=/opt/mxe/usr/bin:$PATH - -WORKDIR / diff --git a/scripts/windows/how-to-push.md b/scripts/windows/how-to-push.md deleted file mode 100644 index 8c1c18d6..00000000 --- a/scripts/windows/how-to-push.md +++ /dev/null @@ -1,19 +0,0 @@ -When you want to build a new version of Qt: -```docker -docker build -t mxe-windows-static . -f Dockerfile-mxe -docker tag mxe-windows-static oldmud0/mxe-qt:5.12.1-win32-static-posix -docker push oldmud0/mxe-qt:5.12.1-win32-static-posix -``` - -Remember to log into Docker Hub before attempting to push. - -When you want to build a new version of any dependency required for building AO: -```docker -docker build -t mxe-windows-static-ao . -f Dockerfile -docker tag mxe-windows-static-ao registry.gitlab.com/attorneyonline/ao2-client/builder-windows-i686 -docker push registry.gitlab.com/attorneyonline/ao2-client/builder-windows-i686 -``` - -Remember to create an access token in GitLab before attempting to push. - -GitLab CI depends on `builder-windows-i686` image to be present in the repository's registry in order for the Windows build to succeed. |
