Skip to content

Update c-cpp.yml

Update c-cpp.yml #156

Workflow file for this run

name: Build
on:
push:
branches: [ shv2 ]
pull_request:
branches: [ shv2 ]
jobs:
build_linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Cache Qt
id: cache-qt
uses: actions/cache@v2
with:
path: ${{ runner.workspace }}/Qt
key: ${{ runner.os }}-Qt
- name: Install Qt
uses: jurplel/install-qt-action@v2
with:
cached: ${{ steps.cache-qt.outputs.cache-hit }}
version: '5.15.0'
host: 'linux'
- name: Get app version
run: |
echo "VERSION=`grep APP_VERSION shvspy/src/appversion.h | cut -d\\" -f2`" >> $GITHUB_ENV
- name: Get AppImageTool
run: |
curl --silent "https://api.github.com/repos/AppImage/AppImageKit/releases/latest" | jq -r '.assets[] | select(.name == "appimagetool-x86_64.AppImage").browser_download_url' | sudo xargs curl -L -o /opt/appimagetool-x86_64.AppImage --create-dirs --url
sudo chmod +x /opt/appimagetool-x86_64.AppImage
- name: Build AppImage
run: |
mkdir ./build
pwd
./make-dist.sh --src-dir . --qt-dir ${Qt5_DIR} --work-dir ./build --appimage-tool /opt/appimagetool-x86_64.AppImage
- name: Save AppImage
uses: actions/upload-artifact@v2
with:
name: shvspy-${{ env.VERSION }}-linux64.Appimage
path: build/artifacts/shvspy-*-linux64.AppImage
- name: Save gzip
uses: actions/upload-artifact@v2
with:
name: shvspy-${{ env.VERSION }}-linux64.tgz
path: build/artifacts/shvspy-*-linux64.tgz
build_windows:
runs-on: windows-2019
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Cache Libs
id: cache-libs
uses: actions/cache@v2
with:
path: |
C:/msys64/mingw64/bin/libiconv-2.dll
C:/msys64/mingw64/bin/libintl-8.dll
C:/msys64/mingw64/bin/libxml2-2.dll
C:/msys64/mingw64/bin/liblzma-5.dll
C:/msys64/mingw64/bin/zlib1.dll
key: ${{ runner.os }}-Libraries
- name: Cache Qt
id: cache-qt
uses: actions/cache@v2
with:
path: ${{ runner.workspace }}\Qt
key: ${{ runner.os }}-Qt
- name: Install Qt
uses: jurplel/install-qt-action@v2
with:
cached: ${{ steps.cache-qt.outputs.cache-hit }}
version: '5.15.0'
host: 'windows'
arch: 'win64_mingw81'
- name: Build
run: |
qmake.exe shvspy.pro -spec win32-g++ "CONFIG+=release"
mingw32-make.exe qmake_all
mingw32-make.exe -j4
shell: cmd
- name: Install language files
run: |
TRANS_DIR=bin/translations
mkdir -p $TRANS_DIR
for tsfile in `find . -name "*.ts"` ; do
qmfile=`basename "${tsfile%.*}.qm"`
echo "$QT_DIR/bin/lrelease $tsfile -qm $TRANS_DIR/$qmfile"
$Qt5_Dir/bin/lrelease $tsfile -qm $TRANS_DIR/$qmfile
done
- name: Get app version
run: echo "VERSION=`grep APP_VERSION shvspy/src/appversion.h | cut -d\\" -f2`" >> $GITHUB_ENV
- name: Create installer
run: |
choco upgrade innosetup --no-progress
"C:\Program Files (x86)\Inno Setup 6\iscc.exe" "/DVERSION=%VERSION%" "/DQT_DIR=%Qt5_Dir%" shvspy/shvspy.iss
shell: cmd
- name: Save setup
uses: actions/upload-artifact@v2
with:
name: shvspy-elektroline-${{ env.VERSION }}-setup.exe
path: _inno\shvspy\shvspy-elektroline-${{ env.VERSION }}-setup.exe