All primary legislation is published. But this needn't be in the primary legislation since there is no need to legislate to make it happen. It's a side deal, the government agrees to do this, the Lords agree not to get in their way.
Much, but not all secondary legislation is also published. A typical means by which Secondary Legislation is brought into existence is that a Law says there shall be some list or reference established by some particular minister, and that document is Secondary Legislation. For example maybe a Law concerning Clown Licensing says there shall be a list of Clown License Offices, and the Secretary of State for Hilarity shall write this list, that list isn't voted on by Parliament, the list gets written by some bureaucrats working for the current Secretary of State for Hilarity. This "undisclosed" list needn't be in secondary legislation either.