2023-04-07 16:07:52 +08:00
|
|
|
name: Build For Windows 10+
|
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
2023-04-20 18:11:09 +08:00
|
|
|
push:
|
|
|
|
tags:
|
|
|
|
- '*'
|
2023-04-07 16:07:52 +08:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: windows-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
|
|
|
|
- name: Checkout Git Repo
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
submodules: true
|
|
|
|
|
2023-08-26 07:37:04 +08:00
|
|
|
- name: Install swig
|
2023-04-07 16:07:52 +08:00
|
|
|
uses: crazy-max/ghaction-chocolatey@v1
|
|
|
|
with:
|
2023-08-26 07:37:04 +08:00
|
|
|
args: install swig -y
|
2023-04-07 16:07:52 +08:00
|
|
|
|
|
|
|
- name: Install Qt
|
|
|
|
uses: jurplel/install-qt-action@v3
|
|
|
|
with:
|
|
|
|
aqtversion: '==3.1.*'
|
|
|
|
py7zrversion: '>=0.20.2'
|
2023-11-07 21:31:07 +08:00
|
|
|
version: '6.5.3'
|
2023-04-07 16:07:52 +08:00
|
|
|
host: 'windows'
|
|
|
|
target: 'desktop'
|
|
|
|
arch: 'win64_mingw'
|
|
|
|
modules: 'qtmultimedia qt5compat qtshadertools'
|
2024-02-27 02:33:49 +08:00
|
|
|
tools: 'tools_opensslv3_x64'
|
2023-04-20 18:11:09 +08:00
|
|
|
|
|
|
|
- name: Disable PCH
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
cd src
|
|
|
|
find -name "*.cpp" -exec sed -i '1i #include "pch.h"' "{}" \;
|
|
|
|
find -name "*.h" -exec sed -i '1i #include "pch.h"' "{}" \;
|
|
|
|
sed -i '1d' pch.h
|
|
|
|
sed -i '/pch.h/d' CMakeLists.txt
|
2023-04-07 16:07:52 +08:00
|
|
|
|
|
|
|
- name: Configure CMake Project
|
|
|
|
working-directory: ${{github.workspace}}
|
|
|
|
env:
|
|
|
|
CMAKE_PREFIX_PATH: ${{env.Qt6_Dir}}
|
2024-02-27 02:33:49 +08:00
|
|
|
OPENSSL_ROOT_DIR: ${{env.Qt6_Dir}}/../../Tools/OpenSSLv3/Win_x64
|
|
|
|
OPENSSL_INCLUDE_DIR: ${{env.OPENSSL_ROOT_DIR}}/include
|
|
|
|
OPENSSL_CRYPTO_LIBRARY: ${{env.OPENSSL_ROOT_DIR}}/bin/libcrypto-3-x64.dll
|
2023-04-07 16:07:52 +08:00
|
|
|
run: |
|
2023-04-20 18:11:09 +08:00
|
|
|
cmake -DCMAKE_BUILD_TYPE=MinSizeRel -G "MinGW Makefiles" -B ${{github.workspace}}/build
|
2023-04-07 16:07:52 +08:00
|
|
|
|
|
|
|
- name: Build project
|
|
|
|
working-directory: ${{github.workspace}}/build
|
2023-04-20 18:11:09 +08:00
|
|
|
run: mingw32-make -j2
|
|
|
|
|
|
|
|
# - name: Setup tmate session
|
|
|
|
# uses: mxschmitt/action-tmate@v3
|
|
|
|
# timeout-minutes: 15
|
2023-04-07 16:07:52 +08:00
|
|
|
|
|
|
|
- name: Compress portable program
|
|
|
|
working-directory: ${{github.workspace}}
|
2023-04-20 18:11:09 +08:00
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
mkdir FreeKill-release
|
|
|
|
cp build/FreeKill.exe FreeKill-release
|
2023-05-20 16:11:16 +08:00
|
|
|
cp -r Fk FreeKill-release
|
2023-04-20 18:11:09 +08:00
|
|
|
cd FreeKill-release
|
|
|
|
windeployqt FreeKill.exe
|
|
|
|
cp -r ../.git .
|
|
|
|
git restore .
|
2023-05-19 07:45:08 +08:00
|
|
|
rm -rf .git* android doc lib lang translations src
|
2023-04-20 18:11:09 +08:00
|
|
|
cd ..
|
|
|
|
cp lib/win/* FreeKill-release
|
|
|
|
cp build/zh_CN.qm FreeKill-release
|
2023-11-07 12:49:31 +08:00
|
|
|
cp build/en_US.qm FreeKill-release
|
2023-11-07 21:31:07 +08:00
|
|
|
cp ../Qt/6.5.3/mingw_64/bin/li*.dll FreeKill-release
|
2024-02-27 02:33:49 +08:00
|
|
|
cp ../Qt/Tools/OpenSSLv3/Win_x64/bin/libcrypto-3-x64.dll' FreeKill-release
|
2023-04-20 18:11:09 +08:00
|
|
|
7z a -t7z FreeKill-release.7z FreeKill-release -r -mx=9 -m0=LZMA2 -ms=10m -mf=on -mhc=on -mmt=on
|
|
|
|
|
|
|
|
- name: Upload Release
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
with:
|
|
|
|
name: zip
|
|
|
|
path: FreeKill-release.7z
|
|
|
|
|
|
|
|
release:
|
2023-05-19 07:45:08 +08:00
|
|
|
name: Release
|
2023-04-20 18:11:09 +08:00
|
|
|
needs: build
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout Git Repo
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
|
|
|
|
- name: Get Previous tag
|
|
|
|
id: previoustag
|
|
|
|
uses: WyriHaximus/github-action-get-previous-tag@v1
|
|
|
|
with:
|
|
|
|
fallback: 0.0.1
|
|
|
|
|
2023-08-26 07:37:04 +08:00
|
|
|
- name: Download zip from build
|
2023-04-20 18:11:09 +08:00
|
|
|
uses: actions/download-artifact@v3
|
|
|
|
with:
|
|
|
|
name: zip
|
|
|
|
path: zip
|
|
|
|
|
|
|
|
- name: Rename 7z
|
2023-04-07 16:07:52 +08:00
|
|
|
run: |
|
2023-04-20 18:11:09 +08:00
|
|
|
mv zip/FreeKill-release.7z zip/FreeKill-${{ steps.previoustag.outputs.tag }}.7z
|
|
|
|
|
2023-08-26 07:37:04 +08:00
|
|
|
- name: Upload Release
|
2023-04-20 18:11:09 +08:00
|
|
|
uses: softprops/action-gh-release@v1
|
|
|
|
with:
|
|
|
|
token: ${{ secrets.MY_TOKEN }}
|
|
|
|
tag_name: ${{ steps.previoustag.outputs.tag }}
|
|
|
|
files: zip/FreeKill-${{ steps.previoustag.outputs.tag }}.7z
|