Skip to content

fix #50

fix #50 #20

Workflow file for this run

name: PyStand
on:
push:
pull_request:
types: [ opened, synchronize, reopened, ready_for_review ]
env:
BUILD_TYPE: Release
jobs:
build-msvc:
if: >-
github.event.pull_request.draft == false
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
arch: [ Win32, x64 ]
subsystem: [ GUI, CLI ]
include:
- generator: Visual Studio 17 2022
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Configure
run: >
cmake
-G "${{ matrix.generator }}"
-A ${{ matrix.arch }}
-B build
${{ matrix.subsystem == 'GUI' && '-DPYSTAND_CONSOLE=OFF' || '-DPYSTAND_CONSOLE=ON' }}
- name: Build
run: |
cmake --build build --config ${{ env.BUILD_TYPE }}
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: PyStand-${{ matrix.arch }}-${{ matrix.subsystem }}
path: build/${{ env.BUILD_TYPE }}
build-gcc:
if: >-
github.event.pull_request.draft == false
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
sys: [ mingw32, mingw64 ]
subsystem: [ GUI, CLI ]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup WinLibs
run: |
if ( '${{ matrix.sys }}' -eq 'mingw32' )
{
Invoke-WebRequest -Uri https://github.com/brechtsanders/winlibs_mingw/releases/download/7.5.0-7.0.0-r1/winlibs-i686-posix-dwarf-gcc-7.5.0-mingw-w64-7.0.0-r1.7z -OutFile ${{ matrix.sys }}.7z
}
else
{
Invoke-WebRequest -Uri https://github.com/brechtsanders/winlibs_mingw/releases/download/7.5.0-7.0.0-r1/winlibs-x86_64-posix-seh-gcc-7.5.0-mingw-w64-7.0.0-r1.7z -OutFile ${{ matrix.sys }}.7z
}
7z x ${{ matrix.sys }}.7z
"${{ github.workspace }}\${{ matrix.sys }}\bin" >> $env:GITHUB_PATH
- name: Configure
run: >
cmake
-G "MinGW Makefiles"
-B build
-DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }}
${{ matrix.subsystem == 'GUI' && '-DPYSTAND_CONSOLE=OFF' || '-DPYSTAND_CONSOLE=ON' }}
- name: Build
run: |
cmake --build build --config ${{ env.BUILD_TYPE }}
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: PyStand-${{ matrix.sys }}-${{ matrix.subsystem }}
path: build\PyStand.exe
release:
if: startsWith(github.ref, 'refs/tags/')
runs-on: windows-latest
needs: [ build-msvc, build-gcc ]
steps:
- name: Download artifacts
uses: actions/download-artifact@v3
- name: List downloaded files
run: ls -R
- name: Create archives
run: >
7z
a
PyStand-v${{ github.ref_name }}-exe.zip
PyStand-Win32-CLI
PyStand-Win32-GUI
PyStand-x64-CLI
PyStand-x64-GUI
PyStand-mingw32-CLI
PyStand-mingw32-GUI
PyStand-mingw64-CLI
PyStand-mingw64-GUI
- name: Release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
generate_release_notes: true
files: |
PyStand*.zip