Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
f1c7c7a
Split src into a core library and app into the CLI binary
thomaslaurenson Sep 17, 2026
90dbb07
Moved the CLI validators into the app
thomaslaurenson Sep 17, 2026
90f69ea
Moved the version, about and completion handlers into the app
thomaslaurenson Sep 17, 2026
d7bd96a
Moved build inputs out of src into cmake and completion
thomaslaurenson Sep 17, 2026
771aeec
Split helpers into a util module
thomaslaurenson Sep 17, 2026
6bc2c6d
Split mpq into per-operation modules
thomaslaurenson Sep 17, 2026
f4ccb0e
Split commands into per-command cli modules
thomaslaurenson Sep 17, 2026
514f1e4
Split gamerules into rules, profiles and profile data
thomaslaurenson Sep 17, 2026
6670510
Wrapped the core library in the mpqcli namespace
thomaslaurenson Sep 17, 2026
3000524
Fixed lint globs and CI path filters after the restructure
thomaslaurenson Sep 17, 2026
0619b9e
Renamed Makefile targets to name the action they perform
thomaslaurenson Sep 17, 2026
2773905
Added directory variables, section markers and a lint configure to th…
thomaslaurenson Sep 17, 2026
b8df3d9
Merge branch 'main' into refactor/project-structure
thomaslaurenson Sep 21, 2026
060caf9
Made an unknown subcommand fail rather than print help and exit zero
thomaslaurenson Sep 22, 2026
d1b1954
Moved the version header into the core and made it constants rather t…
thomaslaurenson Sep 22, 2026
85fd393
Replaced the masked dev release delete with an existence check
thomaslaurenson Sep 22, 2026
6523b44
Resolved the release version from the tag and hardened the version lo…
thomaslaurenson Sep 22, 2026
be40966
Replaced the two Dockerfiles with one static musl image, dropping the…
thomaslaurenson Sep 22, 2026
b6add47
Added a warning bar and fixed the conversions it reported
thomaslaurenson Sep 22, 2026
c967b07
Renamed the release assets to x86_64 and aarch64
thomaslaurenson Sep 23, 2026
3860ed1
Replaced the install scripts with gpipe-generated installers and chec…
thomaslaurenson Sep 23, 2026
6b7f8dd
Ran the image as root with /data as the working directory
thomaslaurenson Sep 23, 2026
79e6f09
Masked the locale to 16 bits when listing files
thomaslaurenson Sep 23, 2026
dbe375a
Smoke-ran the Linux artefacts, saved the image from the amd64 build a…
thomaslaurenson Sep 23, 2026
8aea05c
Included the headers each file uses
thomaslaurenson Sep 23, 2026
ecfff21
Aligned header guards, declaration docs and generated headers across …
thomaslaurenson Sep 23, 2026
7b297da
Removed narrating comments and aligned comment style with the convent…
thomaslaurenson Sep 23, 2026
219f8bc
Updated the contributing guide for the renamed targets and fixed docs…
thomaslaurenson Sep 23, 2026
ac913b4
Bumped the version to 0.12.0 and drafted its changelog entry
thomaslaurenson Sep 23, 2026
9acf012
Set the per-config output directories so every generator writes to bin
thomaslaurenson Sep 24, 2026
73d207d
Installed the clang compiler alongside the lint tools
thomaslaurenson Sep 24, 2026
d466f12
Stopped cancelling in-progress runs on main
thomaslaurenson Sep 24, 2026
2e28273
Granted the build and lint workflows read-only contents
thomaslaurenson Sep 24, 2026
96cf2f5
Included the headers each file uses
thomaslaurenson Sep 24, 2026
c91d52e
Dropped an unused include from the archive module
thomaslaurenson Sep 24, 2026
1c6cd04
Closed every header guard the same way
thomaslaurenson Sep 24, 2026
e2c8460
Added the core alias and linked the app through it
thomaslaurenson Sep 24, 2026
fa61a32
Referred to project directories rather than the outermost project
thomaslaurenson Sep 24, 2026
52f9f78
Said what the signature length cast actually guards against
thomaslaurenson Sep 24, 2026
c9393e3
Used a generic example version in the template comment
thomaslaurenson Sep 24, 2026
e5ba06a
Matched the pull request paths filter to the main one
thomaslaurenson Sep 24, 2026
6d40927
Fixed value completion in the bash, zsh, fish and PowerShell scripts
thomaslaurenson Sep 26, 2026
92e9c05
Added an error hierarchy and an RAII archive, caught in main
thomaslaurenson Sep 26, 2026
1b90aaa
Handed the output streams through the core instead of naming them
thomaslaurenson Sep 26, 2026
4cd56b6
Moved the CLI wiring into app and put the handlers behind options str…
thomaslaurenson Sep 26, 2026
a2eb354
Sent progress and warnings to stderr and moved the tests with them
thomaslaurenson Sep 26, 2026
a66ddfd
Handled Ctrl-C by polling a flag in the core and writing new archives…
thomaslaurenson Sep 26, 2026
b311075
Moved the build trees under build, added check_embed and tidied comme…
thomaslaurenson Sep 26, 2026
bf7a15f
Added FileError, carried paths as filesystem paths through the core a…
thomaslaurenson Sep 27, 2026
257c4b7
Aligned the Makefile targets and sections with the conventions, marke…
thomaslaurenson Sep 27, 2026
1aa13b4
Built and tested natively in test.yml, gated the release artefacts be…
thomaslaurenson Sep 27, 2026
64ccdc7
Threw on a failed enumeration in extract and printed local paths as text
thomaslaurenson Sep 27, 2026
7a0eb19
Tidied comments, condensed the changelog, fixed the docs markdown and…
thomaslaurenson Sep 27, 2026
c3a13cf
Trimmed the game rules comments and put the docs headings in sentence…
thomaslaurenson Sep 27, 2026
b3289f7
Fixed the build directory and venv path in the testing docs
thomaslaurenson Oct 4, 2026
bca96db
Removed the unused build_linux and build_windows targets and pointed …
thomaslaurenson Oct 4, 2026
7e9d516
Brought the MPQCLI_WERROR and fish completion comments up to date
thomaslaurenson Oct 4, 2026
e668ec8
Dropped five unused includes and included profiles.h in profiles.cpp
thomaslaurenson Oct 4, 2026
5197063
Scoped the Pages permissions in the docs workflow to the deploy job
thomaslaurenson Oct 4, 2026
de2227c
Set the 0.12.0 release date to today
thomaslaurenson Oct 4, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
/build
# Local build, docs and test output: large, stale and never read by the image build
build/
book/
.venv/
test/data/

# .git is deliberately not ignored. The root CMakeLists runs git rev-parse to
# stamp the commit into the version header, and without the repository the
# released binary reports "unknown".
127 changes: 57 additions & 70 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,34 @@
name: Build

on:
workflow_call
workflow_call:
inputs:
artifacts:
description: Build the full release artefact set, not just the cheap subset
type: boolean
default: false

permissions:
contents: read

jobs:
build_linux:
strategy:
# Report both architectures independently; one failing says nothing about
# the other, and cancelling hides half the answer
fail-fast: false
matrix:
include:
# AMD64 builds on ubuntu-24.04
- arch: amd64
libc: glibc
runner: ubuntu-24.04
dockerfile: Dockerfile.glibc
platform: linux/amd64
binary_path: /usr/local/bin/mpqcli
- arch: amd64
libc: musl
asset: mpqcli-linux-x86_64
runner: ubuntu-24.04
dockerfile: Dockerfile.musl
platform: linux/amd64
binary_path: /mpqcli
# ARM64 builds on ubuntu-24.04-arm
- arch: arm64
libc: glibc
asset: mpqcli-linux-aarch64
runner: ubuntu-24.04-arm
dockerfile: Dockerfile.glibc
platform: linux/arm64
binary_path: /usr/local/bin/mpqcli
- arch: arm64
libc: musl
runner: ubuntu-24.04-arm
dockerfile: Dockerfile.musl
platform: linux/arm64
binary_path: /mpqcli

runs-on: ${{ matrix.runner }}
steps:
Expand All @@ -42,84 +37,76 @@ jobs:
with:
submodules: true

- name: Build Docker image (${{ matrix.arch }} ${{ matrix.libc }})
- name: Build Docker image (${{ matrix.arch }})
run: |
docker build --platform ${{ matrix.platform }} -t mpqcli-${{ matrix.arch }}-${{ matrix.libc }} -f ${{ matrix.dockerfile }} .
docker build --platform ${{ matrix.platform }} -t mpqcli-${{ matrix.arch }} .

- name: Extract binary from Docker image
run: |
# Create a temporary container from the image
CONTAINER_ID=$(docker create mpqcli-${{ matrix.arch }}-${{ matrix.libc }})
# Copy the binary from the container
docker cp $CONTAINER_ID:${{ matrix.binary_path }} ./mpqcli-linux-${{ matrix.arch }}-${{ matrix.libc }}
# Clean up the container
CONTAINER_ID=$(docker create mpqcli-${{ matrix.arch }})
docker cp $CONTAINER_ID:/mpqcli ./${{ matrix.asset }}
docker rm $CONTAINER_ID

- name: Verify binary
# Run the bytes that will ship: a static binary missing its loader builds
# without complaint and only fails here
- name: Smoke-run the artefact
run: |
file ./mpqcli-linux-${{ matrix.arch }}-${{ matrix.libc }}
echo "Binary created: mpqcli-linux-${{ matrix.arch }}-${{ matrix.libc }}"
chmod +x ./${{ matrix.asset }}
./${{ matrix.asset }} version

- name: Upload binary as artifact
- name: Upload binary as artefact
uses: actions/upload-artifact@v7
with:
name: mpqcli-linux-${{ matrix.arch }}-${{ matrix.libc }}
path: mpqcli-linux-${{ matrix.arch }}-${{ matrix.libc }}
name: ${{ matrix.asset }}
path: ${{ matrix.asset }}
retention-days: 1

build_windows:
runs-on: windows-2022
steps:
- name: Check out repository code
uses: actions/checkout@v6
with:
submodules: true

- name: Run cmake
shell: bash
# The amd64 image is the one published. Saving it here rather than
# rebuilding it in a job of its own means release and prerelease push
# exactly the bytes this job smoke-ran. Only they consume it, so a pull
# request skips the save.
- name: Save Docker image as a tar file
if: matrix.arch == 'amd64' && inputs.artifacts
run: |
cmake -B build \
-G "Visual Studio 17 2022" \
-A x64 \
-DBUILD_MPQCLI=ON

- name: Compile project
run: cmake --build build --config Release

- name: Check mpqcli version
run: build/bin/Release/mpqcli.exe version

- name: Copy mpqcli binary
run: cp build/bin/Release/mpqcli.exe build/bin/mpqcli-windows-amd64.exe
docker tag mpqcli-${{ matrix.arch }} mpqcli
docker save mpqcli -o mpqcli-docker.tar

- name: Upload Artifact
- name: Upload Docker image as artefact
if: matrix.arch == 'amd64' && inputs.artifacts
uses: actions/upload-artifact@v7
with:
name: mpqcli-windows-amd64.exe
path: build/bin/mpqcli-windows-amd64.exe
name: mpqcli-docker
path: mpqcli-docker.tar
retention-days: 1

build_docker:
runs-on: ubuntu-24.04
# Gated on the full artefact set: test.yml already compiles this platform, so
# a pull request learns nothing from a second Windows build, and the runner
# bills at twice a Linux one
build_windows:
if: inputs.artifacts
runs-on: windows-2022
steps:
- name: Check out repository code
uses: actions/checkout@v6
with:
submodules: true

# For the distributable Docker image we use musl
# This results in a smaller image size
- name: Build Docker image (AMD64)
# Raw cmake rather than make: the Makefile needs a POSIX shell, and the
# shipped build gets its own tree rather than the everyday build/dev
- name: Build
shell: bash
run: |
docker build --platform linux/amd64 -t mpqcli -f Dockerfile.musl .
cmake -B build/release -G "Visual Studio 17 2022" -A x64 -DMPQCLI_BUILD_APP=ON
cmake --build build/release --config Release
mv build/release/bin/mpqcli.exe ./mpqcli-windows-x86_64.exe

- name: Save Docker image as a tar file
run: |
docker save mpqcli -o mpqcli-docker.tar
- name: Smoke-run the artefact
shell: bash
run: ./mpqcli-windows-x86_64.exe version

- name: Upload Docker image as artifact
- name: Upload binary as artefact
uses: actions/upload-artifact@v7
with:
name: mpqcli-docker
path: mpqcli-docker.tar
name: mpqcli-windows-x86_64.exe
path: mpqcli-windows-x86_64.exe
retention-days: 1
9 changes: 5 additions & 4 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,8 @@ concurrency:
group: "pages"
cancel-in-progress: false

# Required permissions for GitHub Pages deployment
permissions:
contents: read
pages: write
id-token: write

env:
MDBOOK_VERSION: 0.5.4
Expand All @@ -46,14 +43,18 @@ jobs:
- name: Build docs
run: make docs_build

- name: Upload Pages artifact
- name: Upload Pages artefact
uses: actions/upload-pages-artifact@v5
with:
path: book/

deploy:
needs: build
runs-on: ubuntu-24.04
# Only the deploy job publishes, so only it gets the Pages permissions
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ name: Lint
on:
workflow_call

permissions:
contents: read

jobs:
lint_cpp:
runs-on: ubuntu-24.04
Expand All @@ -12,10 +15,7 @@ jobs:
with:
submodules: true

- run: make install_clang_tools

- run: make configure

- run: make fmt_check
- name: Install clang tools
run: sudo apt-get install -y clang-18 clang-format-18 clang-tidy-18

- run: make lint_cpp
- run: make check_all
36 changes: 21 additions & 15 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,33 +10,39 @@ on:
- ".clang-format"
- ".clang-tidy"
- "src/**"
- "app/**"
- "cmake/**"
- "completion/**"
- "extern/**"
- "test/**"
- "CMakeLists.txt"
- "Dockerfile.glibc"
- "Dockerfile.musl"
- "Dockerfile"
- ".dockerignore"
- ".gpipe.yml"

# Never cancel on main. The prerelease job deletes the dev release, recreates
# its tag and pushes the image; a run cancelled part-way through leaves those
# three disagreeing with each other, which costs more than the runner minutes
# cancelling would save.
concurrency:
group: prerelease
cancel-in-progress: true
group: main-${{ github.ref }}
cancel-in-progress: false

permissions:
contents: write
packages: write
contents: read

jobs:
build:
uses: ./.github/workflows/build.yml
lint:
uses: ./.github/workflows/lint.yml
needs: build
test:
uses: ./.github/workflows/test.yml
needs: build
build:
uses: ./.github/workflows/build.yml
with:
artifacts: true
prerelease:
uses: ./.github/workflows/prerelease.yml
needs:
- build
- lint
- test
secrets: inherit
needs: [build, lint, test]
permissions:
contents: write
packages: write
23 changes: 17 additions & 6 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,35 @@ on:
pull_request:
paths:
- ".github/workflows/**"
- "Makefile"
- ".clang-format"
- ".clang-tidy"
- "src/**"
- "app/**"
- "cmake/**"
- "completion/**"
- "extern/**"
- "test/**"
- "CMakeLists.txt"
- "Dockerfile.glibc"
- "Dockerfile.musl"
- "Dockerfile"
- ".dockerignore"
- ".gpipe.yml"

# Grouped by pull request number, so a push only ever supersedes an earlier run of
# its own branch and never one somebody else is waiting on
concurrency:
group: pr-${{ github.event.pull_request.number }}
cancel-in-progress: true

permissions:
contents: read

# No needs between the three: lint configures its own tree, test builds what it
# runs, and nothing reads build's artefacts until a release
jobs:
build:
uses: ./.github/workflows/build.yml
lint:
uses: ./.github/workflows/lint.yml
needs: build
test:
uses: ./.github/workflows/test.yml
needs: build
build:
uses: ./.github/workflows/build.yml
Loading