| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358 |
- name: Package-Build
- on: [push, pull_request]
- jobs:
- Lint:
- runs-on: macos-11
- steps:
- - name: Checkout
- uses: actions/checkout@v3
- with:
- fetch-depth: 0
- - name: Installing Node
- uses: actions/[email protected]
- with:
- node-version: 16
- - name: Install deps
- run: |
- npm i -g [email protected]
- cd app
- yarn
- cd ..
- rm app/node_modules/.yarn-integrity
- yarn
- - name: Build typings
- run: yarn run build:typings
- - 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
- steps:
- - name: Checkout
- uses: actions/checkout@v3
- with:
- fetch-depth: 0
- - name: Installing Node
- uses: actions/[email protected]
- with:
- node-version: 16
- - name: Install deps
- run: |
- sudo npm i -g [email protected]
- 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: Webpack
- run: yarn run build
- - 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
- # 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 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: 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 ZIP
- with:
- name: macOS .zip (${{matrix.arch}})
- path: artifact-zip
- Linux-Build:
- runs-on: ubuntu-18.04 # build against an older glibc for compatibility
- needs: Lint
- strategy:
- matrix:
- build-arch: [ x64, arm64, armv7l ]
- 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)
- uses: actions/[email protected]
- 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
- npm i -g yarn
- yarn --network-timeout 1000000
- if: matrix.build-arch == 'x64'
- - name: Webpack (x64)
- run: yarn run build
- if: matrix.build-arch == 'x64'
- - name: Prepackage plugins (x64)
- run: scripts/prepackage-plugins.mjs
- if: ${{matrix.build-arch == 'x64'}}
- - name: Build packages (x64)
- run: scripts/build-linux.mjs
- if: ${{matrix.build-arch == 'x64'}}
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- KEYGEN_TOKEN: ${{ secrets.KEYGEN_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.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: Upload symbols
- run: |
- sudo npm install -g @sentry/cli --unsafe-perm
- ./scripts/sentry-upload.mjs
- if: matrix.build-arch == 'x64'
- env:
- SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
- 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'
- - uses: actions/upload-artifact@master
- name: Upload DEB
- with:
- name: Linux DEB (${{matrix.build-arch}})
- path: dist/*.deb
- - uses: actions/upload-artifact@master
- name: Upload RPM
- with:
- name: Linux RPM (${{matrix.build-arch}})
- path: dist/*.rpm
- - uses: actions/upload-artifact@master
- name: Upload Pacman Package
- with:
- name: Linux Pacman (${{matrix.build-arch}})
- path: dist/*.pacman
- - uses: actions/upload-artifact@master
- name: Upload Linux tarball
- with:
- name: Linux tarball (${{matrix.build-arch}})
- path: dist/*.tar.gz
- - uses: actions/upload-artifact@master
- name: Upload web tarball
- with:
- name: Web tarball
- path: tabby-web.tar.gz
- if: matrix.build-arch == 'x64'
- 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
- - name: Installing Node
- uses: actions/[email protected]
- with:
- node-version: 16
- - name: Update node-gyp
- run: |
- npm install --global [email protected]
- npm prefix -g | % {npm config set node_gyp "$_\node_modules\node-gyp\bin\node-gyp.js"}
- - name: Build
- shell: powershell
- run: |
- npm i -g [email protected]
- 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 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: 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 portable build
- with:
- name: Windows portable build (${{matrix.arch}})
- path: artifact-portable
|