Hello, Welcome to Microsoft Q&A,
I can reproduce this issue on Unity 2021.3.29f1. I followed @Y W 's method and it worked for me.
This seems to be a bug in newer versions of Unity, please refer to Bug - Unity version 2021.3.28f1 lacks the UWP Publish Button in Visual Studio Build for package generation - Unity Forum.