Skip to content

Beta 0.4

Beta 0.4 #3

Workflow file for this run

name: release build
on:
release:
types: [published]
jobs:
build:
runs-on: windows-2022
steps:
# Cloning all repository recursively
- name: Get Sources
uses: actions/checkout@v4
with:
submodules: true
# Check this about more info: https://github.com/marketplace/actions/install-version-specific-mingw
# Setting up MinGW_x64 version 8.1.0
- name: Set Up MinGW
uses: egor-tensin/setup-mingw@v2
with:
platform: x64
version: 12.2.0
# Check this about more info: https://github.com/marketplace/actions/install-qt
# This action cannot download needed mingw810
# So it downloads only Qt part
- name: Set Up Qt
uses: jurplel/install-qt-action@v3
with:
version: 5.15.2
arch: win64_mingw81
target: desktop
dir: C:\
# Check this about more info: https://github.com/marketplace/actions/cmake-action
- name: Set Up CMake
uses: threeal/[email protected]
with:
run-build: false
# Compile code
- name: Compile Project
shell: cmd
run: |
:: Remove previous cmake build folder
rmdir /s /q build >nul 2>nul
:: Link MinGW to system variables
mkdir C:\Qt\Tools > nul
mklink C:\Qt\Tools\mingw_64 C:\ProgramData\chocolatey\lib\mingw\tools\install\mingw64 > nul
set PATH=%PATH%;C:\Qt\5.15.2\mingw81_64\bin;C:\Qt\Tools\mingw_64\bin
:: Print header
echo Program: GenHotkeys
echo Authors: mah_boi, nikitvs
echo.
:: Set up cmake config folder for the project
echo Configuring MinGW Make...
cmake -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -DCMAKE_C_COMPILER:FILEPATH=C:\Qt\Tools\mingw_64\bin\gcc.exe -DCMAKE_CXX_COMPILER:FILEPATH=C:\Qt\Tools\mingw_64\bin\g++.exe -S.\ -B.\build -G "MinGW Makefiles"
echo Configuring MinGW Make done
echo.
:: Start compiling
echo Compilation and linking executables...
cmake --build .\build --config Release --target all -j 16
echo Compilation and linking executables done
echo.
:: Add any file to "Logs" folder for the next shipping
mkdir build\exe\Logs >nul 2> nul
cd build\exe\Logs
echo Do not delete this folder, please. Or program will can not be start. > readme.txt
# Check if workflow has been called for release
- name: Development Build Check
shell: pwsh
run: |
if ($env:GitVersion_CommitsSinceVersionSource -ne "0") {
Write-Output "::error:: This is a development build and should not be released. Did you forget to create a new tag for the release?"
exit 1
}
# Compress folder
- name: Zip Artifact
run: 7z a -t7z -mx=9 -m0=lzma2 -ms=on -r -- ${{ format('GenHotkeys-{0}.7z', env.GitVersion_SemVer) }} ./build/exe/*
shell: pwsh
# Upload it to release
- name: Upload Final Artifact to the Release
uses: softprops/action-gh-release@v2
with:
append_body: true
files: ${{ format('GenHotkeys-{0}.7z', env.GitVersion_SemVer) }}