We build nearly topological quantum field theories in various dimensio
ns. We give special attention to the case of eight dimensions for whic
h we first consider theories depending only on Yang-Mills fields. Two
classes of gauge functions exist which correspond to the choices of tw
o different holonomy groups in SO(8), namely SU(4) and Spin(7). The ch
oice of SU(4) gives a quantum field theory for a Calabi-Yau fourfold.
The expectation values for the observables are formally holomorphic Do
naldson invariants, The choice of Spin(7) defines another eight dimens
ional theory for a Joyce manifold which could be of relevance in M- an
d F-theories. Relations to the eight dimensional supersymmetric Yang-M
ills theory are presented. Then, by dimensional reduction, we obtain o
ther theories, in particular a four dimensional one whose gauge condit
ions are identical to the non-abelian Seiberg-Witten equations. The la
tter are thus related to pure Yang-Mills self-duality equations in 8 d
imensions as well as to the N=1, D=10 super Yang-Mills theory. We also
exhibit a theory that couples 3-form gauge fields to the second Chern
class in eight dimensions, and interesting theories in other dimensio
ns.