Skip to content

Simplify CI for Mac (#757) #1438

Simplify CI for Mac (#757)

Simplify CI for Mac (#757) #1438

Workflow file for this run

name: CI
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build-linux:
name: Build Linux
runs-on: ubuntu-latest
permissions:
contents: write
strategy:
matrix:
cxx: [g++, clang++]
steps:
- uses: actions/checkout@v4
- name: apt update
run: sudo apt-get -o Acquire::Retries=3 update
- name: install opengl
run: sudo apt-get -o Acquire::Retries=3 install mesa-common-dev libgl1-mesa-dev libgl1-mesa-glx
- name: install gtk
run: sudo apt-get -o Acquire::Retries=3 install libgtk-3-dev
- name: cmake
run: CXX=${{ matrix.cxx }} cmake -S . -B _build -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=TreeSheets-relocatable -DTREESHEETS_RELOCATABLE_INSTALLATION=ON
- name: build TreeSheets
run: cmake --build _build -j4
- name: install files
run: cmake --install _build
- name: zip
run: zip -r linux_treesheets_${{ matrix.cxx }}.zip TreeSheets-relocatable
- name: upload build artifacts
if: github.ref == 'refs/heads/master'
uses: actions/upload-artifact@v4
with:
name: Linux TreeSheets ${{ matrix.cxx }}
path: TreeSheets-relocatable
- name: Create release
if: github.ref == 'refs/heads/master'
uses: ncipollo/release-action@v1
with:
tag: ${{ github.run_id }}
allowUpdates: true
omitBody: true
commit: master
artifacts: "linux_treesheets_${{ matrix.cxx }}.zip"
build-windows:
name: Build Windows
runs-on: windows-2022
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1.1
- name: clone wxWidgets
run: |
git clone --depth 1 --recurse-submodules https://github.com/wxWidgets/wxWidgets
(gc 'wxWidgets\build\msw\wx_setup.props') -replace '<wxReleaseRuntimeLibrary>MultiThreadedDLL</wxReleaseRuntimeLibrary>', '<wxReleaseRuntimeLibrary>MultiThreaded</wxReleaseRuntimeLibrary>' | Out-File -encoding ASCII 'wxWidgets\build\msw\wx_setup.props'
- name: build wxWidgets
working-directory: wxWidgets
run: msbuild.exe build/msw/wx_vc14.sln /p:Configuration=Release /p:Platform=x64 /p:RuntimeLibrary=MultiThreaded
- name: build TreeSheets
run: |
msbuild.exe TreeSheets\treesheets.sln /p:Configuration=Release /p:Platform=x64
Remove-Item TS\*.pdb
Remove-Item TS\*.ipdb
Remove-Item TS\*.iobj
Compress-Archive -Path TS -DestinationPath windows_treesheets_no_installer.zip
- name: upload build artifacts
uses: actions/upload-artifact@v4
with:
name: Windows TreeSheets (no installer)
path: TS
- name: Create installer
uses: joncloud/makensis-action@v4
with:
script-file: "TS_installer.nsi"
arguments: "/V3"
- name: upload build artifacts
if: github.ref == 'refs/heads/master'
uses: actions/upload-artifact@v4
with:
name: Windows TreeSheets (installer)
path: windows_treesheets_setup.exe
- name: Create release
if: github.ref == 'refs/heads/master'
uses: ncipollo/release-action@v1
with:
tag: ${{ github.run_id }}
allowUpdates: true
omitBody: true
commit: master
artifacts: "windows_treesheets_setup.exe,windows_treesheets_no_installer.zip"
build-mac:
name: Build Mac
runs-on: macos-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: cmake
run: cmake -S . -B _build -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=macos-bundle
- name: Build TreeSheets
run: cmake --build _build -j4
- name: Create bundle
run: cmake --install _build
- name: Zip bundle
run: zip -r mac_treesheets.zip macos-bundle
- name: Create release
if: github.ref == 'refs/heads/master'
uses: ncipollo/release-action@v1
with:
tag: ${{ github.run_id }}
allowUpdates: true
omitBody: true
commit: master
artifacts: "mac_treesheets.zip"