Skip to content

Commit

Permalink
Add Github CI for static builds
Browse files Browse the repository at this point in the history
  • Loading branch information
Atari2 committed Oct 25, 2023
1 parent 8f831dd commit 66f52ae
Showing 1 changed file with 62 additions and 0 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: CMake

permissions:
contents: write

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

env:
BUILD_TYPE: Release

jobs:
build:
runs-on: windows-latest

steps:
- uses: actions/checkout@v3

- name: Setup zlib
shell: pwsh
run: |
vcpkg install zlib:x64-windows zlib:x64-windows-static
- name: Cache qt static build
id: cache-qt-static-build
uses: actions/cache@v3
with:
path: Qt6Static
key: ${{ runner.os }}-Qt6Static

- name: Download and unzip qt static build
shell: pwsh
if: steps.cache-qt-static-build.outputs.cache-hit != 'true'
run: |
Invoke-WebRequest -Uri www.atarismwc.com/Qt6Static.7z -OutFile Qt6Static.7z
7z x -oQt6Static Qt6Static.7z -y
- name: Configure CMake
env:
CMAKE_TOOLCHAIN_FILE: C:/vcpkg/scripts/buildsystems/vcpkg.cmake
run: cmake -S ${{github.workspace}} -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DSTATIC_QT_DIR=${{github.workspace}}/Qt6Static -DCFGEDITOR_BUILD_STATIC=ON

- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}

- name: Upload
uses: actions/upload-artifact@v3
with:
name: CFGEditorPlusPlus
path: ${{github.workspace}}/build/Release/CFGEditorPlusPlus.exe

- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags')
with:
generate_release_notes: true
prerelease: true
files: ${{github.workspace}}/build/Release/CFGEditorPlusPlus.exe

0 comments on commit 66f52ae

Please sign in to comment.