retro-imager/.github/workflows/windows.yml
2024-08-14 00:55:05 -04:00

88 lines
2.1 KiB
YAML

name: Build and Package Windows Release
on:
push:
branches:
- qml
pull_request:
branches:
- qml
jobs:
build:
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Qt
uses: jurplel/install-qt-action@v2
with:
version: '5.15.2'
host: 'windows'
target: 'desktop'
arch: 'win32_mingw81'
dir: ${{ github.workspace }}/Qt
- name: Install Latest CMake
uses: ssrobins/install-cmake@v1
with:
version: '3.22.1'
- name: Install NSIS
uses: crazy-max/ghaction-chocolatey@v2
with:
args: install nsis
- name: Set up environment
run: |
echo "Qt5_DIR=${{ github.workspace }}/Qt/5.x/mingw73_32" >> $GITHUB_ENV
echo "${{ github.workspace }}/Qt/5.x/mingw73_32/bin" >> $GITHUB_PATH
echo "CMAKE_PREFIX_PATH=${{ github.workspace }}/Qt/5.x/mingw73_32" >> $GITHUB_ENV
- name: Build project with CMake
run: |
mkdir build
cd build
cmake -G "MinGW Makefiles" ../src
cmake --build . --config Release
- name: Package installer with NSIS
run: |
cd build
makensis *.nsi
- name: Archive build artifacts
uses: actions/upload-artifact@v3
with:
name: retro-imager-windows
path: build/installer_output.exe
sign:
needs: build
runs-on: windows-latest
if: success()
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Download build artifact
uses: actions/download-artifact@v3
with:
name: retro-imager-windows
path: build/
- name: Sign the installer
run: |
signtool sign /fd SHA256 /a /tr http://timestamp.digicert.com /td SHA256 /d "retro-imager" /du "https://muos.dev" build/installer_output.exe
signtool verify /pa /v build/installer_output.exe
- name: Upload signed artifact
uses: actions/upload-artifact@v3
with:
name: signed-installer
path: build/installer_output.exe