QMake build with gcc in windows #16
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: QMake build with gcc in windows | |
on: | |
push: | |
paths-ignore: | |
- '.github/**' | |
- 'data/ca-bundle.crt' | |
- 'README.md' | |
branches: | |
- master | |
schedule: | |
- cron: '0 0 1 * *' | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: windows-latest | |
defaults: | |
run: | |
shell: msys2 {0} | |
strategy: | |
matrix: | |
include: | |
- { sys: mingw64, env: x86_64 } | |
steps: | |
- name: Checkout branch | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Install toolchain and Qt libraries | |
uses: msys2/setup-msys2@v2 | |
with: | |
msystem: ${{matrix.sys}} | |
update: true | |
install: git make upx p7zip mingw-w64-${{matrix.env}}-toolchain mingw-w64-${{matrix.env}}-qt5 mingw-w64-${{matrix.env}}-qtwebkit mingw-w64-${{matrix.env}}-pkgconf | |
- name: Configure | |
run: | | |
qmake | |
sed 's/windres -i/windres --codepage=65001 -i/g' -i Makefile.Release | |
sed 's/-Wa,-mbig-obj//g' -i Makefile.Release | |
- name: Build | |
run: make release -j$(grep -c ^processor /proc/cpuinfo) | |
- name: Deploy - Qt | |
run: | | |
windeployqt --no-opengl-sw --no-angle --no-system-d3d-compiler --force ./release/target/QuiteRSS.exe | |
- name: Deploy - mingw | |
run: | | |
cp $MSYSTEM_PREFIX/bin/libcrypto-*.dll ./release/target/ | |
cp $MSYSTEM_PREFIX/bin/libssl-*.dll ./release/target/ | |
ldd ./release/target/QuiteRSS.exe | grep "=> /" | grep ${{matrix.sys}} | awk '{print $3}' | xargs -I '{}' cp -v '{}' ./release/target/ | |
- name: Deploy - Qt imageformats dependency | |
working-directory: ./release/target/ | |
run: | | |
find ./imageformats/ -name "*.dll" -exec ldd {} \; | grep "=> /" | grep ${{matrix.sys}} | awk '{print $3}' | xargs -I '{}' cp -v '{}' ./ | |
- name: Deploy - strip | |
run: | | |
find ./release/target/ -name '*.dll' -exec strip {} \; | |
find ./release/target/ -name '*.exe' -exec strip {} \; | |
- name: Deploy - resource | |
run: | | |
cp -rvf ./sound ./release/target/ | |
cp -rvf ./style ./release/target/ | |
touch release/target/portable.dat | |
- name: Deploy - upx | |
run: | | |
upx --best --brute --ultra-brute -v release/target/QuiteRSS.exe | |
- name: Deploy - create file name | |
run: | | |
echo "filename=QuiteRss-gcc-${{matrix.env}}-$(date +"%Y%m%d_%H%M%S")" >> $GITHUB_ENV | |
- name: Deploy - 7z archive | |
run: | | |
7z a -mx=9 ${{ env.filename }}.7z ./release/target/* | |
- name: Upload | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ env.filename }}.7z | |
path: ${{ env.filename }}.7z |