diff --git a/.github/workflows/windows-release-build.yml b/.github/workflows/windows-release-build.yml index e57320e53..64cdacaa8 100644 --- a/.github/workflows/windows-release-build.yml +++ b/.github/workflows/windows-release-build.yml @@ -281,6 +281,11 @@ jobs: run: | set -x mkdir obj-${{ matrix.arch }}-pc-windows-msvc/ + + rm -rf engine/obj-${{ matrix.arch }}-pc-windows-msvc/_tests + rm -rf engine/obj-${{ matrix.arch }}-pc-windows-msvc/config/autoconf.mk + rm -rf engine/obj-${{ matrix.arch }}-pc-windows-msvc/config.statusd/substs/ + cp -r --no-dereference engine/obj-${{ matrix.arch }}-pc-windows-msvc/* obj-${{ matrix.arch }}-pc-windows-msvc/ || true - name: Upload dist object diff --git a/build/winsign/bootstrap.ps1 b/build/winsign/bootstrap.ps1 new file mode 100644 index 000000000..894c33326 --- /dev/null +++ b/build/winsign/bootstrap.ps1 @@ -0,0 +1,7 @@ +(New-Object System.Net.WebClient).DownloadFile("https://ftp.mozilla.org/pub/mozilla/libraries/win32/MozillaBuildSetup-Latest.exe", "C:\MozillaBuildSetup-Latest.exe") +C:\MozillaBuildSetup-Latest.exe /S | out-null + +rustup target add aarch64-pc-windows-msvc +rustup target add x86_64-pc-windows-msvc + +cp -r tests engine/browser/base/zen-components/ diff --git a/build/winsign/sign.ps1 b/build/winsign/sign.ps1 index cb3d0b837..cd4b1c4d7 100644 --- a/build/winsign/sign.ps1 +++ b/build/winsign/sign.ps1 @@ -27,17 +27,20 @@ Start-Job -Name "DownloadGitl10n" -ScriptBlock { echo "Fetched l10n and firefox's one" } -Verbose -ArgumentList $PWD -Debug +Start-Job -Name "SurferInit" -ScriptBlock { + param($PWD) + cd $PWD + surfer -- ci --brand release + npm run import +} -Verbose -ArgumentList $PWD -Debug + gh run download $GithubRunId --name windows-x64-obj-arm64 -D windsign-temp\windows-x64-obj-arm64 echo "Downloaded arm64 artifacts" gh run download $GithubRunId --name windows-x64-obj-x86_64 -D windsign-temp\windows-x64-obj-x86_64 echo "Downloaded x86_64 artifacts" -Wait-Job -Name "DownloadGitl10n" - mkdir engine\obj-x86_64-pc-windows-msvc\ -ErrorAction SilentlyContinue -surfer -- ci --brand release - # Collect all .exe and .dll files into a list $files = Get-ChildItem windsign-temp\windows-x64-obj-x86_64\ -Recurse -Include *.exe $files += Get-ChildItem windsign-temp\windows-x64-obj-x86_64\ -Recurse -Include *.dll @@ -47,12 +50,23 @@ $files += Get-ChildItem windsign-temp\windows-x64-obj-arm64\ -Recurse -Include * signtool.exe sign /n "$SignIdentity" /t http://time.certum.pl/ /fd sha256 /v $files +$env:ZEN_RELEASE="true" +$env:SURFER_SIGNING_MODE="true" +Wait-Job -Name "SurferInit" +Wait-Job -Name "DownloadGitl10n" + function SignAndPackage($name) { echo "Executing on $name" rmdir .\dist -Recurse -ErrorAction SilentlyContinue rmdir engine\obj-x86_64-pc-windows-msvc\ -Recurse -ErrorAction SilentlyContinue cp windsign-temp\windows-x64-obj-$name engine\obj-x86_64-pc-windows-msvc\ -Recurse - echo "Signing $name" + + # Configure each time since we are cloning from a linux environment into + # a windows environment, and the build system is not smart enough to detect that + # we are on a different platform. + cd .\engine + .\mach configure + cd .. echo "Packaging $name" $env:MAR="..\\build\\winsign\\mar.exe" diff --git a/package-lock.json b/package-lock.json index 890a431c5..82f8b9539 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "1.0.0", "license": "MPL-2.0", "dependencies": { - "@zen-browser/surfer": "^1.11.6" + "@zen-browser/surfer": "^1.11.7" }, "devDependencies": { "husky": "^9.1.7", @@ -288,9 +288,10 @@ "license": "MIT" }, "node_modules/@zen-browser/surfer": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@zen-browser/surfer/-/surfer-1.11.6.tgz", - "integrity": "sha512-oKYjpNTPZV3vRxDf7r7pkvYlyNwL8cpsVbVzlb57xCwn7lamXsUioh1mLCSounJ+8cl8bWXhezrnXKXbVjyGww==", + "version": "1.11.7", + "resolved": "https://registry.npmjs.org/@zen-browser/surfer/-/surfer-1.11.7.tgz", + "integrity": "sha512-ltIjDwPiSKmnKYjlTtD307t5h9+igi7YZu3pNlFl0SgvmTGRv9Ayit6CPllN5HGaMoI9jftOSeAaeFX2uRG4Yg==", + "license": "MPL-2.0", "dependencies": { "@resvg/resvg-js": "^1.4.0", "async-icns": "^1.0.2", diff --git a/package.json b/package.json index 87ece0a86..30a790d7b 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ }, "homepage": "https://github.com/zen-browser/desktop#readme", "dependencies": { - "@zen-browser/surfer": "^1.11.6" + "@zen-browser/surfer": "^1.11.7" }, "devDependencies": { "husky": "^9.1.7", diff --git a/scripts/download-language-packs.sh b/scripts/download-language-packs.sh index 869d88827..45b0568d0 100644 --- a/scripts/download-language-packs.sh +++ b/scripts/download-language-packs.sh @@ -1,4 +1,4 @@ -set -ex +set -x if ! [ -z "$ZEN_L10N_CURR_DIR" ]; then cd $ZEN_L10N_CURR_DIR @@ -21,6 +21,16 @@ cd firefox-l10n git checkout $LAST_FIREFOX_L10N_COMMIT cd $CURRENT_DIR +rsyncExists=$(command -v rsync) + +if [ -z "$rsyncExists" ]; then + echo "rsync not found, using cp instead" +else + echo "rsync found!" +fi + +set -e + update_language() { langId=$1 cd ./l10n @@ -28,11 +38,20 @@ update_language() { echo "Updating $langId" # move the contents from ../firefox-l10n/$langId to ./l10n/$langId - rsync -av --progress ../firefox-l10n/$langId/ . --exclude .git + # if rsync exists, use it + # if not, use cp + if [ -z "$rsyncExists" ]; then + cp -r $CURRENT_DIR/l10n/firefox-l10n/$langId/* . + else + rsync -av --progress ../firefox-l10n/$langId/ . --exclude .git + fi cd $CURRENT_DIR } +# remove "\r" from ./l10n/supported-languages +sed -i 's/\r$//' ./l10n/supported-languages + export PATH=~/tools/git-cinnabar:$PATH for lang in $(cat ./l10n/supported-languages); do update_language $lang