Skip to content

Commit

Permalink
Merge pull request #5907 from Jai-JAP/master
Browse files Browse the repository at this point in the history
  • Loading branch information
Eugeny authored Mar 26, 2022
2 parents aee6ae9 + 48c06fc commit 40e0bcc
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 21 deletions.
36 changes: 19 additions & 17 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:
env:
ARCH: ${{matrix.arch}}

- name: Build native deps
- name: Fix cross build
run: |
rm -rf app/node_modules/cpu-features
rm -rf app/node_modules/ssh2/crypto/build
Expand Down Expand Up @@ -199,8 +199,6 @@ jobs:
mv dist/*.rpm artifact-rpm/ || true
mkdir artifact-pacman
mv dist/*.pacman artifact-pacman/ || true
mkdir artifact-snap
mv dist/*.snap artifact-snap/ || true
mkdir artifact-tar.gz
mv dist/*.tar.gz artifact-tar.gz/ || true
mkdir artifact-web
Expand All @@ -209,31 +207,25 @@ jobs:
- uses: actions/upload-artifact@master
name: Upload DEB
with:
name: Linux DEB
name: Linux DEB (x86_64)
path: artifact-deb

- uses: actions/upload-artifact@master
name: Upload RPM
with:
name: Linux RPM
name: Linux RPM (x86_64)
path: artifact-rpm

- uses: actions/upload-artifact@master
name: Upload Pacman Package
with:
name: Linux Pacman
name: Linux Pacman (x86_64)
path: artifact-pacman

- uses: actions/upload-artifact@master
name: Upload Snap
with:
name: Linux Snap
path: artifact-snap

- uses: actions/upload-artifact@master
name: Upload Linux tarball
with:
name: Linux tarball
name: Linux tarball (x86_64)
path: artifact-tar.gz

- uses: actions/upload-artifact@master
Expand All @@ -242,9 +234,15 @@ jobs:
name: Web tarball
path: artifact-web


Windows-Build:
runs-on: windows-2022
needs: Lint
strategy:
matrix:
include:
- arch: x86_64
- arch: arm64

steps:
- name: Checkout
Expand All @@ -270,6 +268,8 @@ jobs:
node scripts/build-native.js
yarn run build
node scripts/prepackage-plugins.js
env:
ARCH: ${{matrix.arch}}

- name: Build and sign packages
run: node scripts/build-windows.js
Expand All @@ -283,6 +283,8 @@ jobs:
- name: Build packages without signing
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')))"
env:
ARCH: ${{matrix.arch}}

- name: Upload symbols
run: |
Expand All @@ -296,18 +298,18 @@ jobs:
- name: Package artifacts
run: |
mkdir artifact-setup
mv dist/*-setup.exe artifact-setup/
mv dist/*-setup-*.exe artifact-setup/
mkdir artifact-portable
mv dist/*-portable.zip artifact-portable/
mv dist/*-portable-*.zip artifact-portable/
- uses: actions/upload-artifact@master
name: Upload installer
with:
name: Windows installer
name: Windows installer (${{matrix.arch}})
path: artifact-setup

- uses: actions/upload-artifact@master
name: Upload portable build
with:
name: Windows portable build
name: Windows portable build (${{matrix.arch}})
path: artifact-portable
2 changes: 2 additions & 0 deletions HACKING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ yarn
./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)
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
Expand Down
6 changes: 3 additions & 3 deletions electron-builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ publish:

win:
icon: "./build/windows/icon.ico"
artifactName: tabby-${version}-portable.${ext}
artifactName: tabby-${version}-portable-${env.ARCH}.${ext}
rfc3161TimeStampServer: http://timestamp.sectigo.com
nsis:
oneClick: false
artifactName: tabby-${version}-setup.${ext}
artifactName: tabby-${version}-setup-${env.ARCH}.${ext}
installerIcon: "./build/windows/icon.ico"
allowToChangeInstallationDirectory: true
shortcutName: Tabby Terminal
Expand All @@ -68,7 +68,7 @@ mac:
linux:
category: "Utility;TerminalEmulator;System"
icon: "./build/icons"
artifactName: tabby-${version}-linux.${ext}
artifactName: tabby-${version}-linux-${env.ARCH}.${ext}
executableArgs:
- "--no-sandbox"
desktop:
Expand Down
4 changes: 4 additions & 0 deletions scripts/build-linux.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@ const vars = require('./vars')

const isTag = (process.env.GITHUB_REF || '').startsWith('refs/tags/')

process.env.ARCH = process.env.ARCH || process.arch === 'arm' ? 'armv7l' : process.arch

builder({
dir: true,
linux: ['deb', 'tar.gz', 'rpm', 'pacman'],
armv7l: process.env.ARCH === 'armv7l',
arm64: process.env.ARCH === 'arm64',
config: {
extraMetadata: {
version: vars.version,
Expand Down
4 changes: 3 additions & 1 deletion scripts/build-native.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@ const rebuild = require('electron-rebuild').default
const path = require('path')
const vars = require('./vars')

process.env.ARCH = process.env.ARCH || process.arch === 'arm' ? 'armv7l' : process.arch

let lifecycles = []
for (let dir of ['app', 'tabby-core', 'tabby-local', 'tabby-ssh', 'tabby-terminal']) {
const build = rebuild({
buildPath: path.resolve(__dirname, '../' + dir),
electronVersion: vars.electronVersion,
arch: process.env.ARCH ?? process.arch,
arch: process.env.ARCH,
force: true,
})
build.catch(e => {
Expand Down
3 changes: 3 additions & 0 deletions scripts/build-windows.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@ const vars = require('./vars')
const isTag = (process.env.GITHUB_REF || process.env.BUILD_SOURCEBRANCH || '').startsWith('refs/tags/')
const isCI = !!process.env.GITHUB_REF

process.env.ARCH = process.env.ARCH || process.arch

builder({
dir: true,
win: ['nsis', 'zip'],
arm64: process.env.ARCH === 'arm64',
config: {
extraMetadata: {
version: vars.version,
Expand Down

0 comments on commit 40e0bcc

Please sign in to comment.