mirror of
https://github.com/Luca1991/NDSFactory.git
synced 2025-07-09 05:30:12 +02:00
Add Windows CI (via GitHub Actions) (#11)
* Create GUI executable if building on Windows * Enable Windows CI (via GitHub Actions)
This commit is contained in:
parent
b334ff78ff
commit
c8fc9006f2
53
.github/workflows/build.yml
vendored
53
.github/workflows/build.yml
vendored
@ -1,6 +1,8 @@
|
|||||||
name: NDSFactory-Builds
|
name: NDSFactory-Builds
|
||||||
|
|
||||||
on: [push]
|
on:
|
||||||
|
push:
|
||||||
|
branches: master
|
||||||
|
|
||||||
env:
|
env:
|
||||||
BUILD_TYPE: Release
|
BUILD_TYPE: Release
|
||||||
@ -28,13 +30,11 @@ jobs:
|
|||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install -y build-essential qt5-default cmake
|
sudo apt-get install -y build-essential qt5-default cmake
|
||||||
mkdir build
|
mkdir build
|
||||||
|
|
||||||
- name: Configure CMake
|
- name: Configure CMake
|
||||||
working-directory: ${{github.workspace}}/build
|
working-directory: ${{github.workspace}}/build
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE ..
|
cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE ..
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
working-directory: ${{github.workspace}}/build
|
working-directory: ${{github.workspace}}/build
|
||||||
shell: bash
|
shell: bash
|
||||||
@ -48,7 +48,6 @@ jobs:
|
|||||||
git_hash=$(git rev-parse --short "$GITHUB_SHA")
|
git_hash=$(git rev-parse --short "$GITHUB_SHA")
|
||||||
cd build
|
cd build
|
||||||
tar -czvf NDSFactory_${git_hash}__Linux_x86_64.tar.gz NDSFactory ../README.md ../LICENSE
|
tar -czvf NDSFactory_${git_hash}__Linux_x86_64.tar.gz NDSFactory ../README.md ../LICENSE
|
||||||
|
|
||||||
- name: Release on GitHub
|
- name: Release on GitHub
|
||||||
uses: ncipollo/release-action@v1
|
uses: ncipollo/release-action@v1
|
||||||
with:
|
with:
|
||||||
@ -78,7 +77,6 @@ jobs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE ..
|
cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE ..
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
working-directory: ${{github.workspace}}/build
|
working-directory: ${{github.workspace}}/build
|
||||||
shell: bash
|
shell: bash
|
||||||
@ -93,7 +91,6 @@ jobs:
|
|||||||
git_hash=$(git rev-parse --short "$GITHUB_SHA")
|
git_hash=$(git rev-parse --short "$GITHUB_SHA")
|
||||||
cd build
|
cd build
|
||||||
zip -r NDSFactory_${git_hash}__macOS_x86_64.zip NDSFactory.app ../README.md ../LICENSE
|
zip -r NDSFactory_${git_hash}__macOS_x86_64.zip NDSFactory.app ../README.md ../LICENSE
|
||||||
|
|
||||||
- name: Release on GitHub
|
- name: Release on GitHub
|
||||||
uses: ncipollo/release-action@v1
|
uses: ncipollo/release-action@v1
|
||||||
with:
|
with:
|
||||||
@ -101,3 +98,47 @@ jobs:
|
|||||||
allowUpdates: true
|
allowUpdates: true
|
||||||
tag: "autobuild"
|
tag: "autobuild"
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
build-windows:
|
||||||
|
runs-on: windows-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Install Qt
|
||||||
|
uses: jurplel/install-qt-action@v2
|
||||||
|
|
||||||
|
- name: Install CMake
|
||||||
|
uses: lukka/get-cmake@latest
|
||||||
|
|
||||||
|
- name: Create Build Environment
|
||||||
|
run: |
|
||||||
|
mkdir build
|
||||||
|
|
||||||
|
- name: Configure CMake
|
||||||
|
working-directory: ${{github.workspace}}/build
|
||||||
|
run: |
|
||||||
|
cmake ..
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
working-directory: ${{github.workspace}}/build
|
||||||
|
run: |
|
||||||
|
cmake --build . -j4 --config Release
|
||||||
|
mkdir .\Release\prod
|
||||||
|
move .\Release\NDSFactory.exe .\Release\prod
|
||||||
|
windeployqt .\Release\prod\NDSFactory.exe
|
||||||
|
|
||||||
|
- name: Archive Artifact
|
||||||
|
working-directory: ${{github.workspace}}/build/Release
|
||||||
|
run: |
|
||||||
|
xcopy ..\..\README.md .\prod
|
||||||
|
xcopy ..\..\LICENSE .\prod
|
||||||
|
powershell "Compress-Archive -Path .\prod\* -DestinationPath .\NDSFactory_AUTOBUILD__Windows_x86_64.zip"
|
||||||
|
|
||||||
|
- name: Release on GitHub
|
||||||
|
uses: ncipollo/release-action@v1
|
||||||
|
with:
|
||||||
|
artifacts: "build/Release/NDSFactory_*__Windows_x86_64.zip"
|
||||||
|
allowUpdates: true
|
||||||
|
tag: "autobuild"
|
||||||
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
@ -39,6 +39,8 @@ set(FORMS
|
|||||||
|
|
||||||
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||||
add_executable(${PROJECT_NAME} MACOSX_BUNDLE ${SOURCES} ${HEADERS} ${FORMS})
|
add_executable(${PROJECT_NAME} MACOSX_BUNDLE ${SOURCES} ${HEADERS} ${FORMS})
|
||||||
|
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
|
||||||
|
add_executable(${PROJECT_NAME} WIN32 ${SOURCES} ${HEADERS} ${FORMS})
|
||||||
else()
|
else()
|
||||||
add_executable(${PROJECT_NAME} ${SOURCES} ${HEADERS} ${FORMS})
|
add_executable(${PROJECT_NAME} ${SOURCES} ${HEADERS} ${FORMS})
|
||||||
endif()
|
endif()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user