Update build.yml

This commit is contained in:
Jai A P
2023-06-19 13:19:21 +05:30
committed by GitHub
parent 60a63d9c65
commit 4d9486e6c1

View File

@@ -1,173 +1,214 @@
name: Package-Build
on: [push, pull_request]
jobs:
Lint:
runs-on: macos-11
# Lint:
# runs-on: macos-11
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
# steps:
# - name: Checkout
# uses: actions/checkout@v3
# with:
# fetch-depth: 0
- name: Installing Node
uses: actions/setup-node@v3.6.0
with:
node-version: 16
# - name: Installing Node
# uses: actions/setup-node@v3.6.0
# with:
# node-version: 16
- name: Install deps
run: |
npm i -g yarn@1.19.1
cd app
yarn
cd ..
rm app/node_modules/.yarn-integrity
yarn
# - name: Install deps
# run: |
# npm i -g yarn@1.19.1
# cd app
# yarn
# cd ..
# rm app/node_modules/.yarn-integrity
# yarn
- name: Build typings
run: yarn run build:typings
# - name: Build typings
# run: yarn run build:typings
- name: Lint
run: yarn run lint
# - name: Lint
# run: yarn run lint
macOS-Build:
runs-on: macos-11
needs: Lint
strategy:
matrix:
include:
- arch: x86_64
- arch: arm64
fail-fast: false
# macOS-Build:
# runs-on: macos-11
# # needs: Lint
# strategy:
# matrix:
# include:
# - arch: x86_64
# - arch: arm64
# fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
# steps:
# - name: Checkout
# uses: actions/checkout@v3
# with:
# fetch-depth: 0
- name: Installing Node
uses: actions/setup-node@v3.6.0
with:
node-version: 16
# - name: Installing Node
# uses: actions/setup-node@v3.6.0
# with:
# node-version: 16
- name: Install deps
run: |
sudo npm i -g yarn@1.22.1
yarn --network-timeout 1000000
env:
ARCH: ${{matrix.arch}}
# - name: Install deps
# run: |
# sudo npm i -g yarn@1.22.1
# yarn --network-timeout 1000000
# env:
# ARCH: ${{matrix.arch}}
- name: Fix cross build
run: |
rm -rf app/node_modules/cpu-features
rm -rf app/node_modules/ssh2/crypto/build
if: matrix.arch == 'arm64'
# - name: Fix cross build
# run: |
# rm -rf app/node_modules/cpu-features
# rm -rf app/node_modules/ssh2/crypto/build
# if: matrix.arch == 'arm64'
- name: Webpack
run: yarn run build
# - name: Webpack
# run: yarn run build
- name: Prepackage plugins
run: scripts/prepackage-plugins.mjs
env:
ARCH: ${{matrix.arch}}
# - name: Prepackage plugins
# run: scripts/prepackage-plugins.mjs
# env:
# ARCH: ${{matrix.arch}}
- run: sed -i '' 's/updateInfo = await/\/\/updateInfo = await/g' node_modules/app-builder-lib/out/targets/ArchiveTarget.js
# - run: sed -i '' 's/updateInfo = await/\/\/updateInfo = await/g' node_modules/app-builder-lib/out/targets/ArchiveTarget.js
# Work around electron-builder beta bug
- run: ln -s ../../node_modules/electron app/node_modules
# # Work around electron-builder beta bug
# - run: ln -s ../../node_modules/electron app/node_modules
- name: Build and sign packages
run: scripts/build-macos.mjs
if: github.repository == 'Eugeny/tabby' && github.event_name == 'push' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags'))
env:
ARCH: ${{matrix.arch}}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
KEYGEN_TOKEN: ${{ secrets.KEYGEN_TOKEN }}
CSC_LINK: ${{ secrets.CSC_LINK }}
CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }}
APPSTORE_USERNAME: ${{ secrets.APPSTORE_USERNAME }}
APPSTORE_PASSWORD: ${{ secrets.APPSTORE_PASSWORD }}
USE_HARD_LINKS: false
# DEBUG: electron-builder,electron-builder:*
# - name: Build and sign packages
# run: scripts/build-macos.mjs
# if: github.repository == 'Eugeny/tabby' && github.event_name == 'push' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags'))
# env:
# ARCH: ${{matrix.arch}}
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# KEYGEN_TOKEN: ${{ secrets.KEYGEN_TOKEN }}
# CSC_LINK: ${{ secrets.CSC_LINK }}
# CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }}
# APPSTORE_USERNAME: ${{ secrets.APPSTORE_USERNAME }}
# APPSTORE_PASSWORD: ${{ secrets.APPSTORE_PASSWORD }}
# USE_HARD_LINKS: false
# # DEBUG: electron-builder,electron-builder:*
- name: Build packages without signing
run: scripts/build-macos.mjs
if: "! (github.repository == 'Eugeny/tabby' && github.event_name == 'push' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags')))"
env:
ARCH: ${{matrix.arch}}
# DEBUG: electron-builder,electron-builder:*
# - name: Build packages without signing
# run: scripts/build-macos.mjs
# if: "! (github.repository == 'Eugeny/tabby' && github.event_name == 'push' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags')))"
# env:
# ARCH: ${{matrix.arch}}
# # DEBUG: electron-builder,electron-builder:*
- name: Upload symbols
run: |
sudo npm install -g @sentry/cli --unsafe-perm
./scripts/sentry-upload.mjs
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
# - name: Upload symbols
# run: |
# sudo npm install -g @sentry/cli --unsafe-perm
# ./scripts/sentry-upload.mjs
# env:
# SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
# SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
# SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
- name: Package artifacts
run: |
mkdir artifact-pkg
mv dist/*.pkg artifact-pkg/
mkdir artifact-zip
mv dist/*.zip artifact-zip/
# - name: Package artifacts
# run: |
# mkdir artifact-pkg
# mv dist/*.pkg artifact-pkg/
# mkdir artifact-zip
# mv dist/*.zip artifact-zip/
- uses: actions/upload-artifact@master
name: Upload PKG
with:
name: macOS .pkg (${{matrix.arch}})
path: artifact-pkg
# - uses: actions/upload-artifact@master
# name: Upload PKG
# with:
# name: macOS .pkg (${{matrix.arch}})
# path: artifact-pkg
- uses: actions/upload-artifact@master
name: Upload ZIP
with:
name: macOS .zip (${{matrix.arch}})
path: artifact-zip
# - uses: actions/upload-artifact@master
# name: Upload ZIP
# with:
# name: macOS .zip (${{matrix.arch}})
# path: artifact-zip
Linux-Build:
runs-on: ubuntu-20.04
needs: Lint
# needs: Lint
strategy:
matrix:
build-arch: [ x64, arm64, armv7l ]
include:
- build-arch: x64
- build-arch: arm64
arch: arm64
triplet: aarch64-linux-gnu-
# - build-arch: armv7l
# arch: armhf
# triplet: arm-linux-gnueabihf-
env:
CC: ${{matrix.triplet}}-gcc
CXX: ${{matrix.triplet}}-g++
ARCH: ${{matrix.build-arch}}
npm_config_arch: ${{matrix.build-arch}}
npm_config_target_arch: ${{matrix.build-arch}}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- 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)
- name: Install Node
uses: actions/setup-node@v3.6.0
with:
node-version: 16
if: matrix.build-arch == 'x64'
- name: Install deps (x64)
run: |
sudo apt-get update
sudo apt-get install libarchive-tools zsh
sudo apt-get install libarchive-tools zsh
- name: Install npm_modules (x64)
run: |
npm i -g yarn
yarn --network-timeout 1000000
yarn --network-timeout 1000000 --arch=${{matrix.arch}}
if: matrix.build-arch == 'x64'
- name: Webpack (x64)
run: yarn run build
if: matrix.build-arch == 'x64'
- name: Setup Crossbuild (${{matrix.build-arch}})
run: |
sudo apt-get update -y && sudo apt-get install schroot sbuild debootstrap -y
sudo mkdir -p /tmp/debootstrap-cache /build-chroot
sudo debootstrap --include=git,curl,gnupg,ca-certificates,crossbuild-essential-${{matrix.arch}},libarchive-tools,cmake --variant=buildd --exclude=snapd --components=main,restricted,universe,multiverse --extractor=dpkg-deb --cache-dir=/tmp/debootstrap-cache/ bionic /build-chroot/
echo 'deb [arch=amd64,i386] http://archive.ubuntu.com/ubuntu bionic main restricted universe multiverse' | sudo tee /build-chroot/etc/apt/sources.list >/dev/null
echo 'deb [arch=arm64,armhf] http://ports.ubuntu.com/ubuntu-ports bionic main restricted universe multiverse' | sudo tee -a /build-chroot/etc/apt/sources.list >/dev/null
curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | gpg --dearmor | sudo tee /build-chroot/etc/apt/trusted.gpg.d/nodesource.gpg >/dev/null
echo 'deb http://deb.nodesource.com/node_16.x bionic main' | sudo tee /build-chroot/etc/apt/sources.list.d/nodesource.list >/dev/null
echo "[build-chroot]
description=Ubuntu 18.04 Build chroot
type=directory
directory=/build-chroot
root-groups=root,sudo
profile=buildd
personality=linux
preserve-environment=false
union-type=overlay" | sudo tee /etc/schroot/chroot.d/build-chroot.pref >/dev/null
echo "/home /home none rw,bind 0 0" | sudo tee -a /etc/schroot/buildd/fstab >/dev/null
if: matrix.build-arch != 'x64'
- name: Prepackage plugins (x64)
- name: Install deps and CrossBuild ${{matrix.build-arch}}
run: |
sudo schroot -c build-chroot -u root -- bash -c "apt-get update -y &&
dpkg --add-architecture ${{matrix.arch}} &&
apt-get install -y nodejs libfontconfig-dev:${{matrix.arch}} libsecret-1-dev:${{matrix.arch}} libnss3:${{matrix.arch}} libatk1.0-0:${{matrix.arch}} libatk-bridge2.0-0:${{matrix.arch}} libgdk-pixbuf2.0-0:${{matrix.arch}} libgtk-3-0:${{matrix.arch}} libgbm1:${{matrix.arch}} &&
npm i -g yarn &&
export CC=${{matrix.triplet}}gcc CXX=${{matrix.triplet}}g++ ARCH=${{matrix.build-arch}} &&
export npm_config_arch=${{matrix.build-arch}} npm_config_target_arch=${{matrix.build-arch}} &&
yarn --network-timeout 1000000 --arch=${{matrix.arch}} &&
yarn run build"
if: matrix.build-arch != 'x64'
- name: Prepackage plugins (${{matrix.build-arch}})
run: scripts/prepackage-plugins.mjs
if: ${{matrix.build-arch == 'x64'}}
- name: Build packages (x64)
- name: Build packages (${{matrix.build-arch}})
run: scripts/build-linux.mjs
if: ${{matrix.build-arch == 'x64'}}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
KEYGEN_TOKEN: ${{ secrets.KEYGEN_TOKEN }}
@@ -178,54 +219,54 @@ jobs:
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.mjs &&
USE_SYSTEM_FPM=true scripts/build-linux.mjs"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
KEYGEN_TOKEN: ${{ secrets.KEYGEN_TOKEN }}
USE_HARD_LINKS: false
if: matrix.build-arch == 'arm64' && github.repository == 'Eugeny/tabby' && startsWith(github.ref, 'refs/tags')
# - 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.mjs &&
# USE_SYSTEM_FPM=true scripts/build-linux.mjs"
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# KEYGEN_TOKEN: ${{ secrets.KEYGEN_TOKEN }}
# USE_HARD_LINKS: false
# if: matrix.build-arch == 'arm64' && github.repository == 'Eugeny/tabby' && startsWith(github.ref, 'refs/tags')
- 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.mjs &&
USE_SYSTEM_FPM=true scripts/build-linux.mjs"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
KEYGEN_TOKEN: ${{ secrets.KEYGEN_TOKEN }}
USE_HARD_LINKS: false
if: matrix.build-arch == 'armv7l' && github.repository == 'Eugeny/tabby' && startsWith(github.ref, 'refs/tags')
# - 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.mjs &&
# USE_SYSTEM_FPM=true scripts/build-linux.mjs"
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# KEYGEN_TOKEN: ${{ secrets.KEYGEN_TOKEN }}
# USE_HARD_LINKS: false
# if: matrix.build-arch == 'armv7l' && github.repository == 'Eugeny/tabby' && startsWith(github.ref, 'refs/tags')
- name: Upload symbols
- name: Upload symbols (x64)
run: |
sudo npm install -g @sentry/cli --unsafe-perm
./scripts/sentry-upload.mjs
@@ -235,35 +276,35 @@ jobs:
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
- name: Upload packages to packagecloud.io
uses: Eugeny/packagecloud-action@main
if: github.repository == 'Eugeny/tabby' && github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
env:
PACKAGECLOUD_TOKEN: ${{ secrets.PACKAGECLOUD_TOKEN }}
with:
repo: 'eugeny/tabby'
dir: 'dist'
# - name: Upload packages to packagecloud.io
# uses: Eugeny/packagecloud-action@main
# if: github.repository == 'Eugeny/tabby' && github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
# env:
# PACKAGECLOUD_TOKEN: ${{ secrets.PACKAGECLOUD_TOKEN }}
# with:
# repo: 'eugeny/tabby'
# dir: 'dist'
- uses: actions/upload-artifact@master
name: Upload DEB
name: Upload DEB (${{matrix.build-arch}})
with:
name: Linux DEB (${{matrix.build-arch}})
path: dist/*.deb
- uses: actions/upload-artifact@master
name: Upload RPM
name: Upload RPM (${{matrix.build-arch}})
with:
name: Linux RPM (${{matrix.build-arch}})
path: dist/*.rpm
- uses: actions/upload-artifact@master
name: Upload Pacman Package
name: Upload Pacman Package (${{matrix.build-arch}})
with:
name: Linux Pacman (${{matrix.build-arch}})
path: dist/*.pacman
- uses: actions/upload-artifact@master
name: Upload Linux tarball
name: Upload Linux tarball (${{matrix.build-arch}})
with:
name: Linux tarball (${{matrix.build-arch}})
path: dist/*.tar.gz
@@ -276,83 +317,83 @@ jobs:
if: matrix.build-arch == 'x64'
Windows-Build:
runs-on: windows-2022
needs: Lint
strategy:
matrix:
include:
- arch: x64
- arch: arm64
fail-fast: false
# Windows-Build:
# runs-on: windows-2022
# # needs: Lint
# strategy:
# matrix:
# include:
# - arch: x64
# - arch: arm64
# fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
# steps:
# - name: Checkout
# uses: actions/checkout@v3
# with:
# fetch-depth: 0
- name: Installing Node
uses: actions/setup-node@v3.6.0
with:
node-version: 16
# - name: Installing Node
# uses: actions/setup-node@v3.6.0
# with:
# node-version: 16
- name: Update node-gyp
run: |
npm install --global node-gyp@8.4.1
npm prefix -g | % {npm config set node_gyp "$_\node_modules\node-gyp\bin\node-gyp.js"}
# - name: Update node-gyp
# run: |
# npm install --global node-gyp@8.4.1
# npm prefix -g | % {npm config set node_gyp "$_\node_modules\node-gyp\bin\node-gyp.js"}
- name: Build
shell: powershell
run: |
npm i -g yarn@1.19.1
yarn --network-timeout 1000000
yarn run build
node scripts/prepackage-plugins.mjs
env:
ARCH: ${{matrix.arch}}
# - name: Build
# shell: powershell
# run: |
# npm i -g yarn@1.19.1
# yarn --network-timeout 1000000
# yarn run build
# node scripts/prepackage-plugins.mjs
# env:
# ARCH: ${{matrix.arch}}
- name: Build and sign packages
run: node scripts/build-windows.mjs
if: github.repository == 'Eugeny/tabby' && github.event_name == 'push' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags'))
env:
ARCH: ${{matrix.arch}}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
KEYGEN_TOKEN: ${{ secrets.KEYGEN_TOKEN }}
WIN_CSC_LINK: ${{ secrets.WIN_CSC_LINK }}
WIN_CSC_KEY_PASSWORD: ${{ secrets.WIN_CSC_KEY_PASSWORD }}
DEBUG: electron-builder,electron-builder:*
# - name: Build and sign packages
# run: node scripts/build-windows.mjs
# if: github.repository == 'Eugeny/tabby' && github.event_name == 'push' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags'))
# env:
# ARCH: ${{matrix.arch}}
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# KEYGEN_TOKEN: ${{ secrets.KEYGEN_TOKEN }}
# WIN_CSC_LINK: ${{ secrets.WIN_CSC_LINK }}
# WIN_CSC_KEY_PASSWORD: ${{ secrets.WIN_CSC_KEY_PASSWORD }}
# DEBUG: electron-builder,electron-builder:*
- name: Build packages without signing
run: node scripts/build-windows.mjs
if: "!(github.repository == 'Eugeny/tabby' && github.event_name == 'push' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags')))"
env:
ARCH: ${{matrix.arch}}
# - name: Build packages without signing
# run: node scripts/build-windows.mjs
# 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: |
npm install @sentry/cli
node scripts/sentry-upload.mjs
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
# - name: Upload symbols
# run: |
# npm install @sentry/cli
# node scripts/sentry-upload.mjs
# env:
# SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
# SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
# SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
- name: Package artifacts
run: |
mkdir artifact-setup
mv dist/*-setup-*.exe artifact-setup/
mkdir artifact-portable
mv dist/*-portable-*.zip artifact-portable/
# - name: Package artifacts
# run: |
# mkdir artifact-setup
# mv dist/*-setup-*.exe artifact-setup/
# mkdir artifact-portable
# mv dist/*-portable-*.zip artifact-portable/
- uses: actions/upload-artifact@master
name: Upload installer
with:
name: Windows installer (${{matrix.arch}})
path: artifact-setup
# - uses: actions/upload-artifact@master
# name: Upload installer
# with:
# name: Windows installer (${{matrix.arch}})
# path: artifact-setup
- uses: actions/upload-artifact@master
name: Upload portable build
with:
name: Windows portable build (${{matrix.arch}})
path: artifact-portable
# - uses: actions/upload-artifact@master
# name: Upload portable build
# with:
# name: Windows portable build (${{matrix.arch}})
# path: artifact-portable