US President Donald Trump has signed a temporary government budget to end the longest government shutdown in US history.