<compilation debug="true"> refers to the page compilation mode at runtime and is not related to your build configuration. This does not affect the main build of your project or library support; just a page.
Publish... will publish assemblies and content using the current assembly configuration, whether it be Debug, Release, or another custom configuration.
If you are using Visual Studio 2010, you can look at the web.config conversions to make sure that you are not freeing the code with the compilation debug flag set to true. http://msdn.microsoft.com/en-us/library/dd465326.aspx
source share