Skip to content

Refactoring PDF import #688

Refactoring PDF import

Refactoring PDF import #688

name: Build Starc for Linux
env:
APP_VERSION: 0.7.6
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
create:
tags:
- v*
workflow_dispatch: {}
jobs:
build_linux:
name: Build Linux version
runs-on: ubuntu-20.04
timeout-minutes: 60
steps:
- name: Checkout sources for push or create tag event
if: ${{ github.event_name != 'pull_request' }}
uses: actions/checkout@master
with:
token: ${{ secrets.ACTION_RUNNER }}
submodules: recursive
fetch-depth: 0
- name: Checkout sources for pull request event
if: ${{ github.event_name == 'pull_request' }}
uses: actions/checkout@master
- name: Checkout submodules for pull request event
if: ${{ github.event_name == 'pull_request' }}
shell: bash
run: |
git submodule update --init --recursive src/3rd_party/qbreakpad/ src/3rd_party/pdfhummus/ src/3rd_party/pdftextextraction/
- name: Add info about dev build to the env
shell: bash
run: |
echo "DEV_BUILD=$(git rev-list `git rev-list --tags --no-walk --max-count=1`..HEAD --count)" >> $GITHUB_ENV
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
version: 5.15.2
target: desktop
- name: Install dependencies
shell: bash
run: |
sudo apt update
sudo apt install libgstreamer-plugins-base1.0-0 cmake make pkg-config libx11-dev xcb libx11-xcb-dev libxkbcommon-x11-0 libxkbcommon-dev libgtk-3-dev sassc
- name: Install Adwaita-qt
run: |
git clone https://github.com/FedoraQt/adwaita-qt.git adwaita-qt
cd adwaita-qt
mkdir build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DUSE_QT6=OFF
make -j2
sudo make install
- name: Install QGnomePlatform
run: |
git clone https://github.com/FedoraQt/QGnomePlatform qgnomeplatform
cd qgnomeplatform
mkdir build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DUSE_QT6=OFF
make -j2
sudo make install
- name: Run QMake
shell: bash
run: |
cd src
qmake starc.pro DEFINES+="DEV_BUILD=$DEV_BUILD"
- name: Build
shell: bash
run: |
cd src
make -j$(nproc)
- name: Make AppImage
shell: bash
run: |
cd build/linux
./make-starc-app-image.sh ${{env.APP_VERSION}}
- name: Collect artifacts
uses: actions/upload-artifact@v3
with:
name: linux packages
path: build/linux/starc-setup.AppImage
- name: Publish artifacts to the dev stream and notify clients
if: startsWith(github.ref, 'refs/tags/') != true
shell: bash
run: |
curl -F "api_key=${{ secrets.STARC_API_KEY }}" -F "name_for_file=starc-setup.AppImage" -F "file_bin=@build/linux/starc-setup.AppImage" https://starc.app/api/app/updates/publish
curl -F "api_key=${{ secrets.STARC_API_KEY }}" -F "system=linux" -F "version=${{env.APP_VERSION}} dev ${{env.DEV_BUILD}}" https://starc.app/api/app/updates/notify
- name: Publish artifacts to the GitHub releases
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: build/linux/starc-setup.AppImage
- name: Notify clients that stable release published
if: startsWith(github.ref, 'refs/tags/')
shell: bash
run: |
curl -F "api_key=${{ secrets.STARC_API_KEY }}" -F "system=linux" -F "version=${{env.APP_VERSION}}" https://starc.app/api/app/updates/notify