Browse Source

Merge pull request #5907 from Jai-JAP/master

Eugeny 3 years ago
parent
commit
40e0bcce17
6 changed files with 34 additions and 21 deletions
  1. 19 17
      .github/workflows/build.yml
  2. 2 0
      HACKING.md
  3. 3 3
      electron-builder.yml
  4. 4 0
      scripts/build-linux.js
  5. 3 1
      scripts/build-native.js
  6. 3 0
      scripts/build-windows.js

+ 19 - 17
.github/workflows/build.yml

@@ -64,7 +64,7 @@ jobs:
       env:
       env:
         ARCH: ${{matrix.arch}}
         ARCH: ${{matrix.arch}}
 
 
-    - name: Build native deps
+    - name: Fix cross build
       run: |
       run: |
         rm -rf app/node_modules/cpu-features
         rm -rf app/node_modules/cpu-features
         rm -rf app/node_modules/ssh2/crypto/build
         rm -rf app/node_modules/ssh2/crypto/build
@@ -199,8 +199,6 @@ jobs:
         mv dist/*.rpm artifact-rpm/ || true
         mv dist/*.rpm artifact-rpm/ || true
         mkdir artifact-pacman
         mkdir artifact-pacman
         mv dist/*.pacman artifact-pacman/ || true
         mv dist/*.pacman artifact-pacman/ || true
-        mkdir artifact-snap
-        mv dist/*.snap artifact-snap/ || true
         mkdir artifact-tar.gz
         mkdir artifact-tar.gz
         mv dist/*.tar.gz artifact-tar.gz/ || true
         mv dist/*.tar.gz artifact-tar.gz/ || true
         mkdir artifact-web
         mkdir artifact-web
@@ -209,31 +207,25 @@ jobs:
     - uses: actions/upload-artifact@master
     - uses: actions/upload-artifact@master
       name: Upload DEB
       name: Upload DEB
       with:
       with:
-        name: Linux DEB
+        name: Linux DEB (x86_64)
         path: artifact-deb
         path: artifact-deb
 
 
     - uses: actions/upload-artifact@master
     - uses: actions/upload-artifact@master
       name: Upload RPM
       name: Upload RPM
       with:
       with:
-        name: Linux RPM
+        name: Linux RPM (x86_64)
         path: artifact-rpm
         path: artifact-rpm
 
 
     - uses: actions/upload-artifact@master
     - uses: actions/upload-artifact@master
       name: Upload Pacman Package
       name: Upload Pacman Package
       with:
       with:
-        name: Linux Pacman
+        name: Linux Pacman (x86_64)
         path: artifact-pacman
         path: artifact-pacman
 
 
-    - uses: actions/upload-artifact@master
-      name: Upload Snap
-      with:
-        name: Linux Snap
-        path: artifact-snap
-
     - uses: actions/upload-artifact@master
     - uses: actions/upload-artifact@master
       name: Upload Linux tarball
       name: Upload Linux tarball
       with:
       with:
-        name: Linux tarball
+        name: Linux tarball (x86_64)
         path: artifact-tar.gz
         path: artifact-tar.gz
 
 
     - uses: actions/upload-artifact@master
     - uses: actions/upload-artifact@master
@@ -242,9 +234,15 @@ jobs:
         name: Web tarball
         name: Web tarball
         path: artifact-web
         path: artifact-web
 
 
+
   Windows-Build:
   Windows-Build:
     runs-on: windows-2022
     runs-on: windows-2022
     needs: Lint
     needs: Lint
+    strategy:
+      matrix:
+        include:
+          - arch: x86_64
+          - arch: arm64
 
 
     steps:
     steps:
     - name: Checkout
     - name: Checkout
@@ -270,6 +268,8 @@ jobs:
         node scripts/build-native.js
         node scripts/build-native.js
         yarn run build
         yarn run build
         node scripts/prepackage-plugins.js
         node scripts/prepackage-plugins.js
+      env:
+        ARCH: ${{matrix.arch}}
 
 
     - name: Build and sign packages
     - name: Build and sign packages
       run: node scripts/build-windows.js
       run: node scripts/build-windows.js
@@ -283,6 +283,8 @@ jobs:
     - name: Build packages without signing
     - name: Build packages without signing
       run: node scripts/build-windows.js
       run: node scripts/build-windows.js
       if: "!(github.repository == 'Eugeny/tabby' && github.event_name == 'push' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags')))"
       if: "!(github.repository == 'Eugeny/tabby' && github.event_name == 'push' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags')))"
+      env:
+        ARCH: ${{matrix.arch}}
 
 
     - name: Upload symbols
     - name: Upload symbols
       run: |
       run: |
@@ -296,18 +298,18 @@ jobs:
     - name: Package artifacts
     - name: Package artifacts
       run: |
       run: |
         mkdir artifact-setup
         mkdir artifact-setup
-        mv dist/*-setup.exe artifact-setup/
+        mv dist/*-setup-*.exe artifact-setup/
         mkdir artifact-portable
         mkdir artifact-portable
-        mv dist/*-portable.zip artifact-portable/
+        mv dist/*-portable-*.zip artifact-portable/
 
 
     - uses: actions/upload-artifact@master
     - uses: actions/upload-artifact@master
       name: Upload installer
       name: Upload installer
       with:
       with:
-        name: Windows installer
+        name: Windows installer (${{matrix.arch}})
         path: artifact-setup
         path: artifact-setup
 
 
     - uses: actions/upload-artifact@master
     - uses: actions/upload-artifact@master
       name: Upload portable build
       name: Upload portable build
       with:
       with:
-        name: Windows portable build
+        name: Windows portable build (${{matrix.arch}})
         path: artifact-portable
         path: artifact-portable

+ 2 - 0
HACKING.md

@@ -14,6 +14,8 @@ yarn
 ./scripts/build-native.js
 ./scripts/build-native.js
 ```
 ```
 
 
+**Note: For compiling for Linux armv7l, you need to downgrade electron to 17.0.0 in package.json present in root directory of tabby source**
+
 ```
 ```
 # Linux (Debian/Ubuntu here as an example)
 # Linux (Debian/Ubuntu here as an example)
 sudo apt install libfontconfig-dev libsecret-1-dev libarchive-tools libnss3 libatk1.0-0 libatk-bridge2.0-0 libgdk-pixbuf2.0-0 libgtk-3-0 libgbm1 cmake
 sudo apt install libfontconfig-dev libsecret-1-dev libarchive-tools libnss3 libatk1.0-0 libatk-bridge2.0-0 libgdk-pixbuf2.0-0 libgtk-3-0 libgbm1 cmake

+ 3 - 3
electron-builder.yml

@@ -39,11 +39,11 @@ publish:
 
 
 win:
 win:
   icon: "./build/windows/icon.ico"
   icon: "./build/windows/icon.ico"
-  artifactName: tabby-${version}-portable.${ext}
+  artifactName: tabby-${version}-portable-${env.ARCH}.${ext}
   rfc3161TimeStampServer: http://timestamp.sectigo.com
   rfc3161TimeStampServer: http://timestamp.sectigo.com
 nsis:
 nsis:
   oneClick: false
   oneClick: false
-  artifactName: tabby-${version}-setup.${ext}
+  artifactName: tabby-${version}-setup-${env.ARCH}.${ext}
   installerIcon: "./build/windows/icon.ico"
   installerIcon: "./build/windows/icon.ico"
   allowToChangeInstallationDirectory: true
   allowToChangeInstallationDirectory: true
   shortcutName: Tabby Terminal
   shortcutName: Tabby Terminal
@@ -68,7 +68,7 @@ mac:
 linux:
 linux:
   category: "Utility;TerminalEmulator;System"
   category: "Utility;TerminalEmulator;System"
   icon: "./build/icons"
   icon: "./build/icons"
-  artifactName: tabby-${version}-linux.${ext}
+  artifactName: tabby-${version}-linux-${env.ARCH}.${ext}
   executableArgs:
   executableArgs:
   - "--no-sandbox"
   - "--no-sandbox"
   desktop:
   desktop:

+ 4 - 0
scripts/build-linux.js

@@ -4,9 +4,13 @@ const vars = require('./vars')
 
 
 const isTag = (process.env.GITHUB_REF || '').startsWith('refs/tags/')
 const isTag = (process.env.GITHUB_REF || '').startsWith('refs/tags/')
 
 
+process.env.ARCH = process.env.ARCH || process.arch === 'arm' ? 'armv7l' : process.arch
+
 builder({
 builder({
     dir: true,
     dir: true,
     linux: ['deb', 'tar.gz', 'rpm', 'pacman'],
     linux: ['deb', 'tar.gz', 'rpm', 'pacman'],
+    armv7l: process.env.ARCH === 'armv7l',
+    arm64: process.env.ARCH === 'arm64',
     config: {
     config: {
         extraMetadata: {
         extraMetadata: {
             version: vars.version,
             version: vars.version,

+ 3 - 1
scripts/build-native.js

@@ -3,12 +3,14 @@ const rebuild = require('electron-rebuild').default
 const path = require('path')
 const path = require('path')
 const vars = require('./vars')
 const vars = require('./vars')
 
 
+process.env.ARCH = process.env.ARCH || process.arch === 'arm' ? 'armv7l' : process.arch
+
 let lifecycles = []
 let lifecycles = []
 for (let dir of ['app', 'tabby-core', 'tabby-local', 'tabby-ssh', 'tabby-terminal']) {
 for (let dir of ['app', 'tabby-core', 'tabby-local', 'tabby-ssh', 'tabby-terminal']) {
     const build = rebuild({
     const build = rebuild({
         buildPath: path.resolve(__dirname, '../' + dir),
         buildPath: path.resolve(__dirname, '../' + dir),
         electronVersion: vars.electronVersion,
         electronVersion: vars.electronVersion,
-        arch: process.env.ARCH ?? process.arch,
+        arch: process.env.ARCH,
         force: true,
         force: true,
     })
     })
     build.catch(e => {
     build.catch(e => {

+ 3 - 0
scripts/build-windows.js

@@ -5,9 +5,12 @@ const vars = require('./vars')
 const isTag = (process.env.GITHUB_REF || process.env.BUILD_SOURCEBRANCH || '').startsWith('refs/tags/')
 const isTag = (process.env.GITHUB_REF || process.env.BUILD_SOURCEBRANCH || '').startsWith('refs/tags/')
 const isCI = !!process.env.GITHUB_REF
 const isCI = !!process.env.GITHUB_REF
 
 
+process.env.ARCH = process.env.ARCH || process.arch
+
 builder({
 builder({
     dir: true,
     dir: true,
     win: ['nsis', 'zip'],
     win: ['nsis', 'zip'],
+    arm64: process.env.ARCH === 'arm64',
     config: {
     config: {
         extraMetadata: {
         extraMetadata: {
             version: vars.version,
             version: vars.version,