瀏覽代碼

fix: don't add extra `insider` to serverDownloadUrlTemplate (#2354)

Baptiste Augrain 1 月之前
父節點
當前提交
8d01927a20
共有 4 個文件被更改,包括 6 次插入20 次删除
  1. 2 0
      dev/build.sh
  2. 2 2
      patches/add-remote-url.patch
  3. 0 18
      patches/insider/add-remote-url.patch
  4. 2 0
      utils.sh

+ 2 - 0
dev/build.sh

@@ -6,6 +6,7 @@
 ###
 
 export APP_NAME="VSCodium"
+export ASSETS_REPOSITORY="VSCodium/vscodium"
 export BINARY_NAME="codium"
 export CI_BUILD="no"
 export GH_REPO_PATH="VSCodium/vscodium"
@@ -21,6 +22,7 @@ export VSCODE_SKIP_NODE_VERSION_CHECK="yes"
 while getopts ":ilops" opt; do
   case "$opt" in
     i)
+      export ASSETS_REPOSITORY="VSCodium/vscodium-insiders"
       export BINARY_NAME="codium-insiders"
       export VSCODE_QUALITY="insider"
       ;;

+ 2 - 2
patches/add-remote-url.patch

@@ -5,7 +5,7 @@ index c1d64c0..3e60e80 100644
 @@ -321,3 +321,3 @@ function packageTask(type, platform, arch, sourceFolderName, destinationFolderNa
  		const productJsonStream = gulp.src(['product.json'], { base: '.' })
 -			.pipe(json({ commit, date: readISODate('out-build'), version }))
-+			.pipe(json({ commit, date: readISODate('out-build'), version, serverDownloadUrlTemplate: 'https://github.com/!!GH_REPO_PATH!!/releases/download/!!RELEASE_VERSION!!/!!APP_NAME_LC!!-reh-${os}-${arch}-!!RELEASE_VERSION!!.tar.gz' }))
++			.pipe(json({ commit, date: readISODate('out-build'), version, serverDownloadUrlTemplate: 'https://github.com/!!ASSETS_REPOSITORY!!/releases/download/!!RELEASE_VERSION!!/!!APP_NAME_LC!!-reh-${os}-${arch}-!!RELEASE_VERSION!!.tar.gz' }))
  			.pipe(es.through(function (file) {
 diff --git a/build/gulpfile.vscode.js b/build/gulpfile.vscode.js
 index 7046ee0..9aa7bb0 100644
@@ -14,5 +14,5 @@ index 7046ee0..9aa7bb0 100644
 @@ -288,3 +288,3 @@ function packageTask(platform, arch, sourceFolderName, destinationFolderName, op
  		const productJsonStream = gulp.src(['product.json'], { base: '.' })
 -			.pipe(json({ commit, date: readISODate('out-build'), checksums, version }))
-+			.pipe(json({ commit, date: readISODate('out-build'), checksums, version, serverDownloadUrlTemplate: 'https://github.com/!!GH_REPO_PATH!!/releases/download/!!RELEASE_VERSION!!/!!APP_NAME_LC!!-reh-${os}-${arch}-!!RELEASE_VERSION!!.tar.gz' }))
++			.pipe(json({ commit, date: readISODate('out-build'), checksums, version, serverDownloadUrlTemplate: 'https://github.com/!!ASSETS_REPOSITORY!!/releases/download/!!RELEASE_VERSION!!/!!APP_NAME_LC!!-reh-${os}-${arch}-!!RELEASE_VERSION!!.tar.gz' }))
  			.pipe(es.through(function (file) {

+ 0 - 18
patches/insider/add-remote-url.patch

@@ -1,18 +0,0 @@
-diff --git a/build/gulpfile.reh.js b/build/gulpfile.reh.js
-index 2606eed..3e60e80 100644
---- a/build/gulpfile.reh.js
-+++ b/build/gulpfile.reh.js
-@@ -321,3 +321,3 @@ function packageTask(type, platform, arch, sourceFolderName, destinationFolderNa
- 		const productJsonStream = gulp.src(['product.json'], { base: '.' })
--			.pipe(json({ commit, date: readISODate('out-build'), version, serverDownloadUrlTemplate: 'https://github.com/!!GH_REPO_PATH!!/releases/download/!!RELEASE_VERSION!!/!!APP_NAME_LC!!-reh-${os}-${arch}-!!RELEASE_VERSION!!.tar.gz' }))
-+			.pipe(json({ commit, date: readISODate('out-build'), version, serverDownloadUrlTemplate: 'https://github.com/!!GH_REPO_PATH!!-insiders/releases/download/!!RELEASE_VERSION!!-insider/!!APP_NAME_LC!!-reh-${os}-${arch}-!!RELEASE_VERSION!!-insider.tar.gz' }))
- 			.pipe(es.through(function (file) {
-diff --git a/build/gulpfile.vscode.js b/build/gulpfile.vscode.js
-index b975c64..9aa7bb0 100644
---- a/build/gulpfile.vscode.js
-+++ b/build/gulpfile.vscode.js
-@@ -288,3 +288,3 @@ function packageTask(platform, arch, sourceFolderName, destinationFolderName, op
- 		const productJsonStream = gulp.src(['product.json'], { base: '.' })
--			.pipe(json({ commit, date: readISODate('out-build'), checksums, version, serverDownloadUrlTemplate: 'https://github.com/!!GH_REPO_PATH!!/releases/download/!!RELEASE_VERSION!!/!!APP_NAME_LC!!-reh-${os}-${arch}-!!RELEASE_VERSION!!.tar.gz' }))
-+			.pipe(json({ commit, date: readISODate('out-build'), checksums, version, serverDownloadUrlTemplate: 'https://github.com/!!GH_REPO_PATH!!-insiders/releases/download/!!RELEASE_VERSION!!-insider/!!APP_NAME_LC!!-reh-${os}-${arch}-!!RELEASE_VERSION!!-insider.tar.gz' }))
- 			.pipe(es.through(function (file) {

+ 2 - 0
utils.sh

@@ -2,6 +2,7 @@
 
 APP_NAME="${APP_NAME:-VSCodium}"
 APP_NAME_LC="$( echo "${APP_NAME}" | awk '{print tolower($0)}' )"
+ASSETS_REPOSITORY="${ASSETS_REPOSITORY:-VSCodium/vscodium}"
 BINARY_NAME="${BINARY_NAME:-codium}"
 GH_REPO_PATH="${GH_REPO_PATH:-VSCodium/vscodium}"
 ORG_NAME="${ORG_NAME:-VSCodium}"
@@ -18,6 +19,7 @@ apply_patch() {
 
   replace "s|!!APP_NAME!!|${APP_NAME}|g" "$1"
   replace "s|!!APP_NAME_LC!!|${APP_NAME_LC}|g" "$1"
+  replace "s|!!ASSETS_REPOSITORY!!|${ASSETS_REPOSITORY}|g" "$1"
   replace "s|!!BINARY_NAME!!|${BINARY_NAME}|g" "$1"
   replace "s|!!GH_REPO_PATH!!|${GH_REPO_PATH}|g" "$1"
   replace "s|!!ORG_NAME!!|${ORG_NAME}|g" "$1"