浏览代码

build(linux): reorganizing appimage build (#831)

Baptiste Augrain 3 年之前
父节点
当前提交
a8964122dc
共有 5 个文件被更改,包括 21 次插入12 次删除
  1. 7 4
      .github/workflows/linux.yml
  2. 1 3
      .gitignore
  3. 1 1
      build.sh
  4. 11 3
      build/linux/appimage/build.sh
  5. 1 1
      build/linux/appimage/recipe.yml

+ 7 - 4
.github/workflows/linux.yml

@@ -85,12 +85,15 @@ jobs:
           cd VSCode-linux-${VSCODE_ARCH}
           tar czf ../VSCodium-linux-${VSCODE_ARCH}-${MS_TAG}.tar.gz .
         if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes'
-        
+
       - name: Move/rename build artifacts
         run: |
-          cp -f out/*.AppImage* .
-          cp -f vscode/.build/linux/deb/*/deb/*.deb .
-          cp -f vscode/.build/linux/rpm/*/*.rpm .
+          cp vscode/.build/linux/deb/*/deb/*.deb .
+          cp vscode/.build/linux/rpm/*/*.rpm .
+
+          if [[ "${VSCODE_ARCH}" == "x64" ]]; then
+            cp build/linux/appimage/out/*.AppImage* .
+          fi
         if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes'
 
       - name: Generate shasums

+ 1 - 3
.gitignore

@@ -1,9 +1,7 @@
 vscode
 VS*/*
 .DS_Store
-out
-pkg2appimage-*.AppImage
-pkg2appimage.AppDir
+build/linux/appimage/out
 build/windows/msi/releasedir
 build/windows/rtf/Readme (Abridged).txt
 build/windows/rtf/TXT to RTF Converter.exe

+ 1 - 1
build.sh

@@ -41,7 +41,7 @@ if [[ "$SHOULD_BUILD" == "yes" ]]; then
       yarn gulp "vscode-linux-${VSCODE_ARCH}-build-deb"
       yarn gulp "vscode-linux-${VSCODE_ARCH}-build-rpm"
       
-      . ../create_appimage.sh
+      . ../build/linux/appimage/build.sh
     fi
   fi
 

+ 11 - 3
create_appimage.sh → build/linux/appimage/build.sh

@@ -1,6 +1,10 @@
 #!/bin/bash
 
-cd ..
+set -ex
+
+CALLER_DIR=$( pwd )
+
+cd "$( dirname "${BASH_SOURCE[0]}" )"
 
 if [[ "$VSCODE_ARCH" == "x64" ]]; then
   wget -c https://github.com/$(wget -q https://github.com/AppImage/pkg2appimage/releases -O - | grep "pkg2appimage-.*-x86_64.AppImage" | head -n 1 | cut -d '"' -f 2)
@@ -14,7 +18,11 @@ if [[ "$VSCODE_ARCH" == "x64" ]]; then
   # remove check so build in docker can succeed
   sed -i 's/grep docker/# grep docker/' pkg2appimage.AppDir/usr/share/pkg2appimage/functions.sh
 
-  bash -ex pkg2appimage.AppDir/AppRun VSCodium-AppImage-Recipe.yml
+  bash -ex pkg2appimage.AppDir/AppRun recipe.yml
+  
+  rm -f pkg2appimage-*.AppImage
+  rm -rf pkg2appimage.AppDir
+  rm -rf VSCodium
 fi
 
-cd vscode
+cd "${CALLER_DIR}"

+ 1 - 1
VSCodium-AppImage-Recipe.yml → build/linux/appimage/recipe.yml

@@ -16,7 +16,7 @@ ingredients:
     - deb http://archive.ubuntu.com/ubuntu/ trusty main universe
   script:
     - pwd
-    - cp ../vscode/.build/linux/deb/amd64/deb/*.deb .
+    - cp ../../../../vscode/.build/linux/deb/amd64/deb/*.deb .
     - ls codium_*.deb | cut -d _ -f 2 > VERSION
 
 script: