Trump signed the Republican bill ending the longest US government shutdown, resuming funding until the end of January.