The go-dota2 build system provides a comprehensive set of development tools and automation targets that support code generation, testing, linting, and formatting. This infrastructure ensures reproducible builds through standardized configurations and automated workflows.
For information about the API generation process itself, see API Generator (apigen) For details on the protobuf generation pipeline, see Protocol Buffer Generation
The Makefile serves as the primary entry point for development tasks. It orchestrates the execution of the generation pipeline, linting, and testing by leveraging aptre, a multi-purpose development tool runner Makefile4
gen: Executes the main Go-based generation orchestrator located in cmd/generate Makefile28-29genproto: Specifically handles the protocol buffer compilation for files in the protocol/ directory using aptre Makefile15-17apigen: Runs the API generation logic located in the ./apigen directory by invoking the generate-api command Makefile23-25updateproto: Runs the generation pipeline but skips the API generation phase by passing the -skip-apigen flag, focusing on updating protocol definitions Makefile19-21lint: Runs the project linter via aptre lint Makefile39-41fix: Attempts to automatically resolve linting and style issues using aptre fix Makefile43-45test: Runs all Go tests in verbose mode across the entire project Makefile47-49format: Ensures consistent code styling by running goimports followed by the standard formatter via aptre Makefile51-55outdated / list: Checks for available updates to project dependencies using aptre outdated Makefile31-38Sources: Makefile1-55
The repository uses GitHub Actions to automate testing and maintenance of generated code.
The tests.yml workflow triggers on pushes and pull requests to the master branch .github/workflows/tests.yml3-8 It utilizes a build matrix for Go 1.26 .github/workflows/tests.yml18-19 and implements aggressive caching for both the Go build cache and module cache to optimize execution time .github/workflows/tests.yml27-43
The workflow execution sequence follows:
go mod vendor to ensure all dependencies are present .github/workflows/tests.yml44-45make lint .github/workflows/tests.yml46-47make test .github/workflows/tests.yml48-49The update-protos.yml workflow runs every three days at midnight UTC or on manual dispatch .github/workflows/update-protos.yml3-7 It automates the synchronization with upstream Dota 2 protobuf definitions:
generator/Protobufs submodule to the latest remote HEAD .github/workflows/update-protos.yml21-24make gen .github/workflows/update-protos.yml31-32go mod tidy to ensure dependency health .github/workflows/update-protos.yml34-35Sources: .github/workflows/tests.yml1-50 .github/workflows/update-protos.yml1-54
The project uses Go modules and Renovate for dependency maintenance.
Renovate is configured to manage dependencies with a semantic prefixing strategy .github/renovate.json4 It specifically disables major version updates for github.com/urfave/cli to prevent breaking changes in the generation CLI tools .github/renovate.json16-21 It also ignores updates for dependencies marked with replace directives in go.mod .github/renovate.json11-15
Title: Build System Entity Mapping
Sources: Makefile1-55 .github/workflows/tests.yml44-49 .github/workflows/update-protos.yml31-32 .github/renovate.json1-23
This diagram illustrates how raw protobuf definitions and source code flow through the build tools to produce the final library artifacts.
Title: Generation and Build Data Flow
Sources: Makefile15-30 .github/workflows/update-protos.yml21-32 Makefile23-25
Sources: