Former deputy prime minister Barnaby Joyce has announced he is resigning from the National Party.