From baa69c753ae23be498b7823252602dc38d275df3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=B8=D1=85=D0=B0=D0=B8=D0=BB=20=D0=94=D1=80=D0=B0?= =?UTF-8?q?=D0=B3=D1=83=D0=BD=D0=BA=D0=B8=D0=BD?= Date: Mon, 13 Apr 2026 18:57:04 +0300 Subject: [PATCH 1/4] fix: typo in documentation file --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 378f97c..8a8f9c4 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ A command-line tool to extract files from MPQ archives (used by Blizzard games). -Works on MacOS X, Linux and Windows. +Works on macOS, Linux and Windows. ## IN CASE OF ERROR (COMPILATION PROBLEMS / EXTRACTION ISSUES) @@ -180,7 +180,7 @@ inside the MPQ archive:** ## License -MPQExtractor is is made available under the MIT License. The text of the license is in the file 'LICENSE'. +MPQExtractor is made available under the MIT License. The text of the license is in the file 'LICENSE'. Under the MIT License you may use MPQExtractor for any purpose you wish, without warranty, and modify it if you require, subject to one condition: From 828c1f9d055364002a6b5dfa8110bea8423d137b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=B8=D1=85=D0=B0=D0=B8=D0=BB=20=D0=94=D1=80=D0=B0?= =?UTF-8?q?=D0=B3=D1=83=D0=BD=D0=BA=D0=B8=D0=BD?= Date: Mon, 13 Apr 2026 18:57:21 +0300 Subject: [PATCH 2/4] feature: add docker support --- Dockerfile | 31 +++++++++++++++++++++++++ README.md | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 98 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..4084f95 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,31 @@ +FROM debian:trixie-slim AS mpq-extractor-builder-debian +RUN < [!NOTE] + > Typically, building `mpq-extractor-debian` image is required only once. + > This image will contain only the built `MPQExtractor` binary, + > without build tools like `gcc` or `make`. + > Compilation process itself occurs inside the `mpq-extractor-builder-debian` container. + > Such design is used to get optimal image. + + > [!TIP] + > When it's required to play with compilation interactively, such command may be used: + > + > ```sh + > docker build --target mpq-extractor-builder-debian -t mpq-extractor-builder-debian . + > docker run -it --rm --volume "$PWD:/src" --entrypoint '/bin/bash' mpq-extractor-builder-debian + > # ... do something inside the container, for example `cmake /src` + > ``` + +3. Run binary from container + Synopsis: + ``` + docker run --rm -it mpq-extractor-debian [MPQExtractor ARGUMENTS ...] + ``` + + Print help: + + ```sh + docker run --rm -it mpq-extractor-debian -h + ``` + + > [!NOTE] + > Container filesystem is isolated from host filesystem, to make host directories accessible from the container, + > it's required to mount it on `docker run` command invocation, for example: + > + > ```sh + > export MPQ_DATA_DIR="/home/user/Documents/World of Warcraft 3.3.5a/Data" # directory on host + > export OUT_DATA_DIR="/home/user/Documents/MPQExtractor-output" # directory on host + > + > docker run -it --rm \ + > --volume "$MPQ_DATA_DIR:/opt/data" \ + > --volume "$OUT_DATA_DIR:/opt/data/out" \ + > mpq-extractor-debian \ + > -l /opt/data/out/list.txt /opt/data/patch-4.MPQ + > + > cat "$OUT_DATA_DIR/list.txt" # Print file on host (which created in container) + > ``` + + > [!TIP] + > Like in example from previous step, when it's required to play with container (containing + > the only `MPQExtractor`) interactively, such command may be used: + > + > ```sh + > docker run -it --rm --volume "$PWD:/opt/data" --entrypoint '/bin/bash' mpq-extractor-debian + > # ... do something inside the container, for example `MPQExtractor -h` + > ``` + + See [Usage](#usage) section for more usage examples. ## License From 91ea5aed8a69e02ee441f91a23234ccc6772f339 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=B8=D1=85=D0=B0=D0=B8=D0=BB=20=D0=94=D1=80=D0=B0?= =?UTF-8?q?=D0=B3=D1=83=D0=BD=D0=BA=D0=B8=D0=BD?= Date: Mon, 13 Apr 2026 18:57:34 +0300 Subject: [PATCH 3/4] feature: setup github CI/CD workflow --- .github/workflows/ci.yaml | 101 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100644 .github/workflows/ci.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..1a592b6 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,101 @@ +name: CI/CD + +on: + push: + tags: [ '*.*.*' ] + branches: [ '*' ] + pull_request: + branches: [ master ] + release: + types: [ published ] + +permissions: + contents: write + id-token: write + packages: write + +jobs: + build: + name: Build + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v6 + + - name: Setup environment + run: | + git submodule init + git submodule update + + - name: Build + run: | + mkdir ./public-build + docker build --target mpq-extractor-debian -t mpq-extractor-debian . + docker cp $(docker create mpq-extractor-debian):/usr/local/bin/MPQExtractor ./public-build/MPQExtractor + + - name: '"Test"' + run: | + { + echo '```' + # todo replace with `docker run --rm --entrypoint 'bash -c "cmake /src && make tests"' mpq-extractor-builder-debian` in future, + # now just "print help" to prove this thing working. + docker run --rm mpq-extractor-debian -h + echo '```' + } > "$GITHUB_STEP_SUMMARY" + + - name: Save Docker Image to File + run: docker save -o mpq-extractor-debian.tar mpq-extractor-debian + + - name: Upload Image Artifact + uses: actions/upload-artifact@v4 + with: + name: docker-image + path: mpq-extractor-debian.tar + + - name: Upload Binary Artifact + uses: actions/upload-artifact@v4 + with: + name: public-build-artifact + path: ./public-build/ + + publish: + name: Publish + runs-on: ubuntu-latest + needs: [build] + if: startsWith(github.ref, 'refs/tags/') + + steps: + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Download Image Artifact (Docker Image) + uses: actions/download-artifact@v4 + with: + name: docker-image + + - name: Load Image and Push to GHCR + run: | + docker load -i mpq-extractor-debian.tar + + docker tag mpq-extractor-debian ghcr.io/${{ github.repository_owner }}/mpq-extractor-debian:${{ github.ref_name }} + docker tag mpq-extractor-debian ghcr.io/${{ github.repository_owner }}/mpq-extractor-debian:latest + docker push ghcr.io/${{ github.repository_owner }}/mpq-extractor-debian:${{ github.ref_name }} + docker push ghcr.io/${{ github.repository_owner }}/mpq-extractor-debian:latest + + - name: Download Binary Artifact (MPQExtractor) + uses: actions/download-artifact@v4 + with: + name: public-build-artifact + + - name: Create GitHub Release + uses: softprops/action-gh-release@v1 + with: + files: MPQExtractor + generate_release_notes: true + prerelease: false + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From f09881a32d02a6debc6d57ba787c00e02c3d83fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=B8=D1=85=D0=B0=D0=B8=D0=BB=20=D0=94=D1=80=D0=B0?= =?UTF-8?q?=D0=B3=D1=83=D0=BD=D0=BA=D0=B8=D0=BD?= Date: Mon, 13 Apr 2026 23:18:08 +0300 Subject: [PATCH 4/4] fix: docker usage section markup in readme document --- README.md | 134 ++++++++++++++++++++++++++++-------------------------- 1 file changed, 69 insertions(+), 65 deletions(-) diff --git a/README.md b/README.md index e52b000..322609f 100644 --- a/README.md +++ b/README.md @@ -179,71 +179,75 @@ inside the MPQ archive:** ## Usage with Docker -1. Initialize submodule dependencies - ```sh - git submodule init - git submodule update - ``` -2. Build docker image - ```sh - docker build --target mpq-extractor-debian -t mpq-extractor-debian . - ``` - - > [!NOTE] - > Typically, building `mpq-extractor-debian` image is required only once. - > This image will contain only the built `MPQExtractor` binary, - > without build tools like `gcc` or `make`. - > Compilation process itself occurs inside the `mpq-extractor-builder-debian` container. - > Such design is used to get optimal image. - - > [!TIP] - > When it's required to play with compilation interactively, such command may be used: - > - > ```sh - > docker build --target mpq-extractor-builder-debian -t mpq-extractor-builder-debian . - > docker run -it --rm --volume "$PWD:/src" --entrypoint '/bin/bash' mpq-extractor-builder-debian - > # ... do something inside the container, for example `cmake /src` - > ``` - -3. Run binary from container - Synopsis: - ``` - docker run --rm -it mpq-extractor-debian [MPQExtractor ARGUMENTS ...] - ``` - - Print help: - - ```sh - docker run --rm -it mpq-extractor-debian -h - ``` - - > [!NOTE] - > Container filesystem is isolated from host filesystem, to make host directories accessible from the container, - > it's required to mount it on `docker run` command invocation, for example: - > - > ```sh - > export MPQ_DATA_DIR="/home/user/Documents/World of Warcraft 3.3.5a/Data" # directory on host - > export OUT_DATA_DIR="/home/user/Documents/MPQExtractor-output" # directory on host - > - > docker run -it --rm \ - > --volume "$MPQ_DATA_DIR:/opt/data" \ - > --volume "$OUT_DATA_DIR:/opt/data/out" \ - > mpq-extractor-debian \ - > -l /opt/data/out/list.txt /opt/data/patch-4.MPQ - > - > cat "$OUT_DATA_DIR/list.txt" # Print file on host (which created in container) - > ``` - - > [!TIP] - > Like in example from previous step, when it's required to play with container (containing - > the only `MPQExtractor`) interactively, such command may be used: - > - > ```sh - > docker run -it --rm --volume "$PWD:/opt/data" --entrypoint '/bin/bash' mpq-extractor-debian - > # ... do something inside the container, for example `MPQExtractor -h` - > ``` - - See [Usage](#usage) section for more usage examples. +1\. Initialize submodule dependencies + +```sh +git submodule init +git submodule update +``` + +2\. Build docker image + +```sh +docker build --target mpq-extractor-debian -t mpq-extractor-debian . +``` + +> [!NOTE] +> Typically, building `mpq-extractor-debian` image is required only once. +> This image will contain only the built `MPQExtractor` binary, +> without build tools like `gcc` or `make`. +> Compilation process itself occurs inside the `mpq-extractor-builder-debian` container. +> Such design is used to get optimal image. + +> [!TIP] +> When it's required to play with compilation interactively, such command may be used: +> +> ```sh +> docker build --target mpq-extractor-builder-debian -t mpq-extractor-builder-debian . +> docker run -it --rm --volume "$PWD:/src" --entrypoint '/bin/bash' mpq-extractor-builder-debian +> # ... do something inside the container, for example `cmake /src` +> ``` + +3\. Run binary from container + +Synopsis: +``` +docker run --rm -it mpq-extractor-debian [MPQExtractor ARGUMENTS ...] +``` + +Print help: + +```sh +docker run --rm -it mpq-extractor-debian -h +``` + +> [!NOTE] +> Container filesystem is isolated from host filesystem, to make host directories accessible from the container, +> it's required to mount it on `docker run` command invocation, for example: +> +> ```sh +> export MPQ_DATA_DIR="/home/user/Documents/World of Warcraft 3.3.5a/Data" # directory on host +> export OUT_DATA_DIR="/home/user/Documents/MPQExtractor-output" # directory on host +> +> docker run -it --rm \ +> --volume "$MPQ_DATA_DIR:/opt/data" \ +> --volume "$OUT_DATA_DIR:/opt/data/out" \ +> mpq-extractor-debian \ +> -l /opt/data/out/list.txt /opt/data/patch-4.MPQ +> +> cat "$OUT_DATA_DIR/list.txt" # Print file on host (which created in container) +> ``` + +> [!TIP] +> Like in example from previous step, when it's required to play with container (containing +> the only `MPQExtractor`) interactively, such command may be used: +> +> ```sh +> docker run -it --rm --volume "$PWD:/opt/data" --entrypoint '/bin/bash' mpq-extractor-debian +> # ... do something inside the container, for example `MPQExtractor -h` +> ``` + +See [Usage](#usage) section for more usage examples. ## License