6.4.0 #308
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CMake Build | |
on: | |
release: | |
types: [published] | |
push: | |
branches: | |
- 'release/**' | |
workflow_dispatch: | |
env: | |
BUILD_TYPE: Release | |
VERSION_NAME: ${{ github.event.release.tag_name }} | |
jobs: | |
linux: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Install dependencies | |
run: | | |
sudo apt-get install -y libyaml-cpp-dev libarchive-dev wget ninja-build libxkbcommon0 libxkbcommon-x11-0 libxcb-cursor-dev | |
wget https://github.com/linuxdeploy/linuxdeploy/releases/download/1-alpha-20220822-1/linuxdeploy-x86_64.AppImage | |
chmod +x linuxdeploy-x86_64.AppImage | |
wget https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage | |
chmod +x linuxdeploy-plugin-qt-x86_64.AppImage | |
sudo add-apt-repository universe | |
sudo apt install libfuse2 | |
- name: Switch to Python 3.12 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.12' | |
- name: Install Qt | |
uses: jurplel/install-qt-action@v3 | |
with: | |
version: 6.6.1 | |
target: desktop | |
- name: Configure CMake | |
working-directory: ${{github.workspace}} | |
run: cmake -DCMAKE_BUILD_TYPE=Release . -G Ninja | |
- name: Build | |
working-directory: ${{github.workspace}} | |
run: ninja | |
- name: Deploy | |
run: | | |
./linuxdeploy-x86_64.AppImage --appdir=csmm-x86_64 -e csmm -d csmm.desktop -i AppIcon.png -p qt | |
cp -r -t csmm-x86_64/usr/bin wit szs py csmmpython | |
ARCH=x86_64 ./linuxdeploy-x86_64.AppImage --appdir=csmm-x86_64 -p qt -o appimage | |
mv csmm*.AppImage csmm-$VERSION_NAME-linux.AppImage | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
files: ${{github.workspace}}/csmm-${{github.event.release.tag_name}}-linux.AppImage | |
macos: | |
runs-on: macos-14 | |
defaults: | |
run: | |
shell: bash -el {0} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Install dependencies | |
run: brew install libarchive ninja | |
- name: Install Qt | |
uses: jurplel/install-qt-action@v3 | |
with: | |
version: 6.6.1 | |
target: desktop | |
- name: Install x86_64 Homebrew | |
run: arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" | |
- name: Install x86_64 yaml-cpp | |
run: arch -x86_64 /usr/local/bin/brew install yaml-cpp | |
- name: Install miniconda | |
working-directory: ${{github.workspace}} | |
run: | | |
mkdir -p ~/miniconda3 | |
curl https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-arm64.sh -o ~/miniconda3/miniconda.sh | |
bash ~/miniconda3/miniconda.sh -b -u -p ~/miniconda3 | |
rm -rf ~/miniconda3/miniconda.sh | |
source ~/miniconda3/bin/activate | |
conda init bash | |
- name: Set up x86_64 conda env | |
run: | | |
conda create -n x86_env -y | |
conda activate x86_env | |
conda config --env --set subdir osx-64 | |
conda install -p ~/miniconda3/envs/x86_env python=3.12 | |
pip install sphinx==7.2.6 pillow==10.2.0 | |
- name: Configure CMake | |
working-directory: ${{github.workspace}} | |
run: conda activate x86_env && cmake -DPython3_ROOT_DIR=~/miniconda3/envs/x86_env/ -DCMAKE_BUILD_TYPE=Release . -G Ninja | |
- name: Build | |
working-directory: ${{github.workspace}} | |
run: ninja | |
- name: Build docs | |
working-directory: ${{github.workspace}}/docs | |
run: | | |
conda activate x86_env | |
export SPHINXBUILD="python -m sphinx" | |
make html | |
cd _build | |
zip -r "csmm-$VERSION_NAME-pydocs.zip" html | |
- name: Shut down XProtectBehaviorService, which interferes with macdeployqt | |
working-directory: ${{github.workspace}} | |
run: | | |
echo killing...; sudo pkill -9 XProtect >/dev/null || true; | |
echo waiting...; while pgrep XProtect; do sleep 3; done; | |
- name: Deploy | |
working-directory: ${{github.workspace}} | |
run: conda activate x86_env && macdeployqt6 'csmm.app' -dmg | |
- name: Rename | |
working-directory: ${{github.workspace}} | |
run: mv 'csmm.dmg' "csmm-$VERSION_NAME-macos.dmg" | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
files: | | |
${{github.workspace}}/csmm-${{github.event.release.tag_name}}-macos.dmg | |
${{github.workspace}}/docs/_build/csmm-${{github.event.release.tag_name}}-pydocs.zip | |
windows: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Install Qt | |
uses: jurplel/install-qt-action@v3 | |
with: | |
version: 6.6.1 | |
target: desktop | |
arch: win64_msvc2019_64 | |
- name: Install Ninja | |
uses: seanmiddleditch/gha-setup-ninja@master | |
- name: Setup VS Environment | |
uses: seanmiddleditch/gha-setup-vsdevenv@master | |
- name: Switch to Python 3.12 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.12' | |
- name: Configure CMake | |
working-directory: ${{github.workspace}} | |
shell: bash | |
run: cmake -DCMAKE_BUILD_TYPE=Release . -G Ninja | |
- name: Build | |
working-directory: ${{github.workspace}} | |
run: ninja | |
- name: Rename | |
working-directory: ${{github.workspace}} | |
shell: bash | |
run: | | |
mkdir "csmm-$VERSION_NAME" | |
mv "csmm.exe" "csmm-$VERSION_NAME/csmm.exe" | |
mv "wit" "csmm-$VERSION_NAME/wit" | |
mv "szs" "csmm-$VERSION_NAME/szs" | |
mv "csmmpython.exe" "csmm-$VERSION_NAME/csmmpython.exe" | |
- name: Deploy | |
working-directory: ${{github.workspace}} | |
shell: bash | |
run: windeployqt "csmm-$VERSION_NAME/csmm.exe" | |
- name: Copy dlls | |
working-directory: ${{github.workspace}} | |
shell: bash | |
run: | | |
PYVER=$(py --version | sed 's/Python //') | |
CONDENSEDPYVER=$(echo $PYVER | sed 's/\([0-9]*\)\.\([0-9]*\).*/\1\2/') | |
cp "C:\Program Files\OpenSSL\bin\libcrypto-1_1-x64.dll" "csmm-$VERSION_NAME" | |
cp "C:\Program Files\OpenSSL\bin\libssl-1_1-x64.dll" "csmm-$VERSION_NAME" | |
cp "C:/hostedtoolcache/windows/Python/$PYVER/x64/python$CONDENSEDPYVER.dll" "csmm-$VERSION_NAME" | |
- name: Copy Python stdlib | |
working-directory: ${{github.workspace}} | |
shell: bash | |
run: | | |
mkdir "csmm-$VERSION_NAME/py" | |
cp -R "py/Lib" "csmm-$VERSION_NAME/py" | |
- name: Archive | |
uses: thedoctor0/zip-release@main | |
with: | |
type: 'zip' | |
directory: ${{github.workspace}} | |
filename: csmm-${{github.event.release.tag_name}}-windows.zip | |
path: ./csmm-${{github.event.release.tag_name}}/ | |
- name: Release | |
uses: svenstaro/upload-release-action@v2 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: ${{github.workspace}}/csmm-${{github.event.release.tag_name}}-windows.zip | |
tag: ${{ github.ref }} | |
overwrite: true |