I did this because I was not happy with ccnet's package publisher. First you need to trick ccnet into creating a dummy package; the package will be created in [ArtifactDirectory]\[CCNetLabel]. Then run a nant script which replaces the package and updates the package xml.
ccnet config:
<publishers>
<package>
<name>Build-$[$CCNetLabel]</name>
<compression>0</compression>
<packageList />
</package>
<nant>
<buildArgs>-D:PackageName="Build-$[$CCNetLabel]"</buildArgs>
<buildFile>script.build</buildFile>
<targetList>
<target>PackagePublisher</target>
</targetList>
</nant>
</publishers>
nant:
<target name="PackagePublisher">
<property name="PackageDirectory" value="${CCNetArtifactDirectory}\${CCNetLabel}" />
<property name="PackageFullPath" value="${PackageDirectory}\${PackageName}.zip" />
<delete file="${PackageFullPath}" />
<zip zipfile="${PackageFullPath}">
<fileset>
<!-- include everything you need to package -->
</fileset>
</zip>
<!-- find package.xml; it is the only xml file in the PackageDirectory -->
<foreach item="File" property="PackageXml">
<in>
<items basedir="${PackageDirectory}">
<include>*.xml</include>
</items>
</in>
<do>
<xmlpoke file="${PackageXml}" xpath="//package[@name='${PackageName}']/@size" value="${file::get-length(PackageFullPath)}" />
</do>
</foreach>
</target>
The last part ensures the package size is displayed properly in the PackageList web page.