With the Publish step I recommend using a different workspace for Publish from your Populate workspace. I normally add a '-publish' prefix to the workspace name e.g.
Assuming that the file.txt is not read during the build, but only written/generated. I would suggest that your Populate workspace View excludes the file (use a '-//file.txt' mapping if necessary). Then only map the files to be submitted in your Publish workspace.
The Populate workspace view is used to determine if a change has occurred and therefore must not include 'file.txt'.