@@ -81,107 +81,6 @@ func createPdbLzsa(dir string) error {
8181 return createLzsaFromFiles ("SumatraPDF.pdb.lzsa" , dir , pdbFiles )
8282}
8383
84- // build, sign, upload latest pre-release build
85- func buildSignAndUploadPreRelease () {
86- if ! isGithubMyMasterBranch () {
87- logf ("buildSignAndUploadPreRelease: skipping build because not on master branch\n " )
88- return
89- }
90- ver := getPreReleaseVer ()
91- logf ("buildSignAndUploadPreRelease: ver: %s\n " , ver )
92- isClean := isGitClean ("." )
93- if ! isClean {
94- logf ("will not upload because git is not clean\n " )
95- }
96- verifyBuildNotInStorageMust (newMinioR2Client (), buildTypePreRel , ver )
97- verifyBuildNotInStorageMust (newMinioBackblazeClient (), buildTypePreRel , ver )
98-
99- detectSigntoolPathMust ()
100- detectMakeAppxPathMust ()
101- genHTMLDocsForApp ()
102-
103- setBuildConfigPreRelease ()
104- defer revertBuildConfig ()
105-
106- msbuildPath := detectMsbuildPathMust ()
107- dirDst := filepath .Join ("out" , "artifacts" , ver )
108- if ! isClean {
109- dirDst += "-dirty"
110- }
111- must (os .RemoveAll (dirDst ))
112-
113- build := func (plat * Platform ) {
114- prefix := "SumatraPDF-prerel-" + plat .suffix
115- srcDstFileNames := getFileNamesWithPrefix (prefix )
116-
117- slnPath := filepath .Join ("vs2022" , "SumatraPDF.sln" )
118- buildDir := plat .outDir
119- config := "Release"
120- // when !isClean we assume it's interactive testing so we don't
121- // re-build from scratch because it's time consuming
122- if isClean {
123- os .RemoveAll (buildDir )
124- }
125-
126- p := fmt .Sprintf (`/p:Configuration=%s;Platform=%s` , config , plat .vsplatform )
127- t := `/t:test_util`
128- runExeLoggedMust (msbuildPath , slnPath , t , p , `/m` )
129- // can't run arm binaries in x86 CI
130- if plat .vsplatform != kVSPlatformArm64 {
131- runTestUtilMust (buildDir )
132- }
133-
134- t = `/t:SumatraPDF;SumatraPDF-dll;PdfFilter;PdfPreview`
135- runExeLoggedMust (msbuildPath , slnPath , t , p , `/m` )
136- err := createPdbZip (buildDir )
137- must (err )
138- err = createPdbLzsa (buildDir )
139- must (err )
140-
141- // copy to dest dir
142- for _ , file := range srcDstFileNames {
143- srcPath := filepath .Join (buildDir , file [0 ])
144- dstName := file [1 ]
145- dstPath := filepath .Join (dirDst , dstName )
146- copyFile2Must (dstPath , srcPath , true )
147- }
148- }
149-
150- for _ , plat := range platforms {
151- build (plat )
152- }
153-
154- // sign all files in one swoop
155- // build can take a long time and signing rquires user interaction
156- // so wait for user to press enter
157- waitForEnter ("\n Press enter to sign and upload the builds" )
158- err := signExesInDir (dirDst )
159- if err != nil {
160- os .RemoveAll (dirDst )
161- must (err )
162- }
163-
164- // create SumatraPDF-{prefix}.zip with SumatraPDF-{prefix}.exe inside
165- // this must happen after signing
166- for _ , plat := range platforms {
167- prefix := "SumatraPDF-prerel-" + plat .suffix
168- nameInZip := fmt .Sprintf ("SumatraPDF-prerel-%s-%s.exe" , ver , plat .suffix )
169- zipPath := filepath .Join (dirDst , fmt .Sprintf ("%s.zip" , prefix ))
170- exePath := filepath .Join (dirDst , fmt .Sprintf ("%s.exe" , prefix ))
171- err = createExeZipWithGoWithName (dirDst , exePath , zipPath , nameInZip )
172- must (err )
173- }
174-
175- manifestPath := filepath .Join (dirDst , "SumatraPDF-prerel-manifest.txt" )
176- createManifestMust (manifestPath )
177-
178- if ! isClean {
179- logf ("buildSignAndUploadPreRelease: will skip upload because git is not clean\n " )
180- uploadDryRun = true
181- }
182- uploadToStorage (buildTypePreRel , ver , dirDst )
183- }
184-
18584// func copyBuiltFiles(dstDir string, srcDir string, prefix string) {
18685// files := getFileNamesWithPrefix(prefix)
18786// for _, f := range files {
@@ -391,57 +290,6 @@ func addZipFile(w *zip.Writer, path string) error {
391290 return addZipFileWithName (w , path , nameInZip )
392291}
393292
394- func createExeZipWithGoWithName (dir , exePath , zipPath , nameInZip string ) error {
395- f , err := os .Create (zipPath )
396- if err != nil {
397- return err
398- }
399- defer func () {
400- err = f .Close ()
401- }()
402- zw := zip .NewWriter (f )
403- err = addZipFileWithName (zw , exePath , nameInZip )
404- if err != nil {
405- return err
406- }
407- err = zw .Close ()
408- if err != nil {
409- return err
410- }
411- return err
412- }
413-
414- // func createExeZipWithPigz(dir string) {
415- // srcFile := "SumatraPDF.exe"
416- // srcPath := filepath.Join(dir, srcFile)
417- // panicIf(!fileExists(srcPath), "file '%s' doesn't exist\n", srcPath)
418-
419- // // this is the file that pigz.exe will create
420- // dstFileTmp := "SumatraPDF.exe.zip"
421- // dstPathTmp := filepath.Join(dir, dstFileTmp)
422- // removeFileMust(dstPathTmp)
423-
424- // // this is the file we want at the end
425- // dstFile := "SumatraPDF.zip"
426- // dstPath := filepath.Join(dir, dstFile)
427- // removeFileMust(dstPath)
428-
429- // wd, err := os.Getwd()
430- // must(err)
431- // pigzExePath := filepath.Join(wd, "bin", "pigz.exe")
432- // panicIf(!fileExists(pigzExePath), "file '%s' doesn't exist\n", pigzExePath)
433- // cmd := exec.Command(pigzExePath, "-11", "--keep", "--zip", srcFile)
434- // // in pigz we don't control the name of the file created inside so
435- // // so when we run pigz the current directory is the same as
436- // // the directory with the file we're compressing
437- // cmd.Dir = dir
438- // runCmdMust(cmd)
439-
440- // panicIf(!fileExists(dstPathTmp), "file '%s' doesn't exist\n", dstPathTmp)
441- // err = os.Rename(dstPathTmp, dstPath)
442- // must(err)
443- // }
444-
445293var pdbFiles = []string {"libmupdf.pdb" , "SumatraPDF-dll.pdb" , "SumatraPDF.pdb" }
446294
447295func createPdbZip (dir string ) error {
@@ -575,47 +423,6 @@ func buildPreRelease(plat *Platform) {
575423 buildAll ("Release" , plat .vsplatform , plat .outDir )
576424}
577425
578- // TODO:
579- func buildRelease () {
580- panic ("FIXME" )
581-
582- // make sure we can sign the executables, early exit if missing
583- detectSigntoolPathMust ()
584- genHTMLDocsForApp ()
585-
586- ver := getVerForBuildType (buildTypeRel )
587- s := fmt .Sprintf ("buidling release version %s" , ver )
588- defer makePrintDuration (s )()
589-
590- verifyBuildNotInStorageMust (newMinioR2Client (), buildTypeRel , ver )
591- verifyBuildNotInStorageMust (newMinioBackblazeClient (), buildTypeRel , ver )
592-
593- removeReleaseBuilds ()
594- setBuildConfigRelease ()
595- defer revertBuildConfig ()
596-
597- // build("Release", kPlatformNameIntel32)
598- // nameInZip := fmt.Sprintf("SumatraPDF-%s-32.exe", ver)
599- // createExeZipWithGoWithName(rel32Dir, nameInZip)
600-
601- // build("Release", kPlatformNameIntel64)
602- // nameInZip = fmt.Sprintf("SumatraPDF-%s-64.exe", ver)
603- // createExeZipWithGoWithName(rel64Dir, nameInZip)
604-
605- // build("Release", kPlatformNameArm64)
606- // nameInZip = fmt.Sprintf("SumatraPDF-%s-arm64.exe", ver)
607- // createExeZipWithGoWithName(relArm64Dir, nameInZip)
608-
609- // createManifestMust(ver)
610-
611- // dstDir := filepath.Join("out", "artifacts", "rel-"+ver)
612- // prefix := fmt.Sprintf("SumatraPDF-%s", ver)
613- // copyBuiltFiles(dstDir, rel32Dir, prefix)
614- // copyBuiltFiles(dstDir, rel64Dir, prefix+"-64")
615- // copyBuiltFiles(dstDir, relArm64Dir, prefix+"-arm64")
616- // copyBuiltManifest(dstDir, ver, prefix)
617- }
618-
619426func detectVersionsCodeQL () {
620427 //ver := getGitLinearVersionMust()
621428 ver := 16648 // we don't have git history in codeql checkout
0 commit comments