Method and system for compiling and issuing code file

The invention discloses a method and a system for compiling and issuing a code file. The method comprises the following steps that: a compiling instruction used for initiating the compilation on the code file is detected; after the compiling instruction is detected, the code file to be compiled is compiled, in addition, a current compiling file is generated, and the version information of the current compiling file is recorded; the tested compiling file in the version one former than the current compiling version is obtained according to the version information of the current compiling file; the current compiling file and the tested compiling file are compared, and a change file list between the current compiling file and the tested compiling file is obtained; and the compiling file to be tested and a change file are output to be used as test files for being tested. The method and the system provided by the invention have the advantages that the compiling and the test issuing are combined, so the current compiling file can be tested in a targeted way in the test issuing process according to differences between the current compiling file and the tested compiling file, and the editing and issuing efficiency is improved.