Realization of Lieb lattice in covalent-organic frameworks with tunable topology and magnetism