Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added linux arm64 and armv7l to build workflows #6612

Merged
merged 9 commits into from
Sep 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
107 changes: 78 additions & 29 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
- arch: x86_64
- arch: arm64
fail-fast: false

steps:
- name: Checkout
uses: actions/checkout@v3
Expand Down Expand Up @@ -125,45 +125,106 @@ jobs:
Linux-Build:
runs-on: ubuntu-18.04 # build against an older glibc for compatibility
needs: Lint
strategy:
matrix:
build-arch: [ x64, arm64, armv7l ]

if: matrix.build-arch == "x64" || (github.repository == 'Eugeny/tabby' && startsWith(github.ref, 'refs/tags'))

steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Install Node
- name: Set up multiarch/qemu-user-static
run: docker run --rm --privileged multiarch/qemu-user-static:register --reset
if: ${{matrix.build-arch != 'x64'}}

- name: Install Node (x64)
uses: actions/setup-node@v3.2.0
with:
node-version: 16
if: ${{matrix.build-arch == 'x64'}}

- name: Install deps
- name: Install deps (x64)
run: |
sudo apt-get update
sudo apt-get install libarchive-tools zsh
npm i -g yarn@1.19.1
npm i -g yarn
yarn --network-timeout 1000000
if: ${{matrix.build-arch == 'x64'}}

- name: Webpack
- name: Webpack (x64)
run: yarn run build
if: ${{matrix.build-arch == 'x64'}}

- name: Prepackage plugins
- name: Prepackage plugins (x64)
run: scripts/prepackage-plugins.js
if: ${{matrix.build-arch == 'x64'}}

- name: Build packages
- name: Build packages (x64)
run: scripts/build-linux.js
if: ${{matrix.build-arch == 'x64'}}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
USE_HARD_LINKS: false
# DEBUG: electron-builder,electron-builder:*

- name: Build web resources
run: zsh -c 'tar czf tabby-web.tar.gz (tabby-*|web)/dist'
if: ${{matrix.build-arch == 'x64'}}

- name: Install deps and Build (arm64)
uses: docker://multiarch/ubuntu-core:arm64-bionic
with:
args: >
bash -c
"apt update && apt install curl lsb-release gnupg -y &&
curl -fsSL https://deb.nodesource.com/setup_16.x | bash - &&
apt install make build-essential git ruby libarchive-tools nodejs rpm libsecret-1-dev libfontconfig1-dev -y &&
git config --global --add safe.directory /github/workspace &&
gem install public_suffix -v 4.0.7 &&
gem install fpm --no-document &&
npm i -g yarn &&
cd /github/workspace &&
yarn --network-timeout 1000000 &&
yarn run build &&
scripts/prepackage-plugins.js &&
USE_SYSTEM_FPM=true scripts/build-linux.js"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
USE_HARD_LINKS: false
if: ${{matrix.build-arch == 'arm64'}}

- name: Install deps and Build (armv7l)
uses: docker://multiarch/ubuntu-core:armhf-bionic
with:
args: >
bash -c
"apt update && apt install curl lsb-release gnupg -y &&
curl -fsSL https://deb.nodesource.com/setup_16.x | bash - &&
apt install make build-essential git ruby libarchive-tools nodejs rpm libsecret-1-dev libfontconfig1-dev -y &&
git config --global --add safe.directory /github/workspace &&
gem install public_suffix -v 4.0.7 &&
gem install fpm --no-document &&
npm i -g yarn &&
cd /github/workspace &&
sed -i '/ \"electron\":/c\ \"electron\": \"17.0.0\",' package.json &&
yarn --network-timeout 1000000 &&
yarn run build &&
scripts/prepackage-plugins.js &&
USE_SYSTEM_FPM=true scripts/build-linux.js"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
USE_HARD_LINKS: false
if: ${{matrix.build-arch == 'armv7l'}}

- name: Upload symbols
run: |
sudo npm install -g @sentry/cli --unsafe-perm
./scripts/sentry-upload.js
if: ${{matrix.build-arch == 'x64'}}
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
Expand All @@ -178,48 +239,36 @@ jobs:
repo: 'eugeny/tabby'
dir: 'dist'

- name: Package artifacts
run: |
mkdir artifact-deb
mv dist/*.deb artifact-deb/ || true
mkdir artifact-rpm
mv dist/*.rpm artifact-rpm/ || true
mkdir artifact-pacman
mv dist/*.pacman artifact-pacman/ || true
mkdir artifact-tar.gz
mv dist/*.tar.gz artifact-tar.gz/ || true
mkdir artifact-web
mv tabby-web.tar.gz artifact-web/ || true

- uses: actions/upload-artifact@master
name: Upload DEB
with:
name: Linux DEB (x86_64)
path: artifact-deb
name: Linux DEB (${{matrix.build-arch}})
path: dist/*.deb

- uses: actions/upload-artifact@master
name: Upload RPM
with:
name: Linux RPM (x86_64)
path: artifact-rpm
name: Linux RPM (${{matrix.build-arch}})
path: dist/*.rpm

- uses: actions/upload-artifact@master
name: Upload Pacman Package
with:
name: Linux Pacman (x86_64)
path: artifact-pacman
name: Linux Pacman (${{matrix.build-arch}})
path: dist/*.pacman

- uses: actions/upload-artifact@master
name: Upload Linux tarball
with:
name: Linux tarball (x86_64)
path: artifact-tar.gz
name: Linux tarball (${{matrix.build-arch}})
path: dist/*.tar.gz

- uses: actions/upload-artifact@master
name: Upload web tarball
with:
name: Web tarball
path: artifact-web
path: tabby-web.tar.gz
if: ${{matrix.build-arch == 'x64'}}


Windows-Build:
Expand Down
17 changes: 10 additions & 7 deletions scripts/build-linux.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,13 @@ builder({
extraMetadata: {
version: vars.version,
},
publish: {
provider: 'github',
channel: `latest-${process.arch}`,
},
},
publish: isTag ? 'always' : 'onTagOrDraft',
}).catch(() => process.exit(1))
        publish: process.env.GH_TOKEN || process.env.GITHUB_TOKEN ? {
            provider: 'github',
            channel: `latest-${process.env.ARCH}`,
        } : undefined,
    },
     publish: ( process.env.GH_TOKEN || process.env.GITHUB_TOKEN ) ? ( isTag ? 'always' : 'onTagOrDraft' ) : 'never',
}).catch(e => {
console.error(e)
process.exit(1)
})
4 changes: 2 additions & 2 deletions scripts/build-macos.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ builder({
identity: !process.env.CI || process.env.CSC_LINK ? undefined : null,
},
npmRebuild: process.env.ARCH !== 'arm64',
publish: process.env.GH_TOKEN ? {
publish: process.env.GH_TOKEN || process.env.GITHUB_TOKEN ? {
provider: 'github',
channel: `latest-${process.env.ARCH}`,
} : undefined,
},
publish: isTag ? 'always' : 'onTagOrDraft',
publish: ( process.env.GH_TOKEN || process.env.GITHUB_TOKEN ) ? ( isTag ? 'always' : 'onTagOrDraft' ) : 'never',
}).catch(e => {
console.error(e)
process.exit(1)
Expand Down
9 changes: 6 additions & 3 deletions scripts/build-windows.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,13 @@ builder({
extraMetadata: {
version: vars.version,
},
publish: process.env.GH_TOKEN ? {
publish: process.env.GH_TOKEN || process.env.GITHUB_TOKEN ? {
provider: 'github',
channel: `latest-${process.arch}`,
} : undefined,
},
publish: isTag ? 'always' : 'onTagOrDraft',
}).catch(() => process.exit(1))
publish: ( process.env.GH_TOKEN || process.env.GITHUB_TOKEN ) ? ( isTag ? 'always' : 'onTagOrDraft' ) : 'never',
}).catch(e => {
console.error(e)
process.exit(1)
})