Release #34
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: Release | |
on: | |
workflow_dispatch: | |
jobs: | |
build: | |
name: Build | |
permissions: | |
contents: 'write' | |
strategy: | |
matrix: | |
os: [ubuntu-22.04, windows-2022, macos-12] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Update packages (Ubuntu) | |
run: sudo apt update | |
if: matrix.os == 'ubuntu-22.04' | |
# Install Ninja, Qt and setup MSVC - installation of Ninja is not needed on Windows, because it is already installed on the Windows image (in MSVC) | |
- name: Install Ninja (Ubuntu) | |
run: sudo apt install -y ninja-build | |
if: matrix.os == 'ubuntu-22.04' | |
- name: Install Ninja (macOS) | |
run: brew install ninja | |
if: matrix.os == 'macos-12' | |
- name: Install Qt6.6.0 (All platforms) | |
uses: jurplel/install-qt-action@v3 | |
with: | |
# See https://ddalcino.github.io/aqt-list-server/ | |
aqtversion: '==3.1.*' | |
version: '6.6.0' | |
modules: 'qtmultimedia' | |
cache: true | |
cache-key-prefix: install-qt-6.6.0-action-${{ runner.os }} | |
- name: Setup MSVC 2022 for C++ (Windows) | |
# See supported versions here: https://doc.qt.io/qt-6/windows.html | |
uses: ilammy/msvc-dev-cmd@v1 | |
if: matrix.os == 'windows-2022' | |
# Checkout | |
- name: Checkout (All platforms) | |
uses: actions/checkout@v4 | |
# Update version | |
- name: Cache Node modules (All platforms) | |
uses: actions/cache@v3 | |
with: | |
path: node_modules | |
key: node-${{ runner.os }}-${{ hashFiles('package-lock.json') }} | |
- name: Install semantic-release (All platforms) | |
run: npm install | |
- name: Update version (All platforms) | |
run: python deploy/update_version.py src/VERSION.h | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# Build | |
- name: Build (All platforms) | |
# No need to set CMAKE_PREFIX_PATH, because install-qt-action did the work for us | |
run: cmake -G Ninja "-DCMAKE_BUILD_TYPE:STRING=Release" -S . -B build && cmake --build build --config Release | |
# Package with windeployqt + zip (Windows) | |
# TODO: Use NSIS to create an installer (Extract files, silently install vc_redist.x64.exe, create start menu entry, etc.) | |
- name: Use windeployqt and zip (Windows) | |
run: | | |
mkdir GlyphVisualizer-$((Get-Content .version)) && mv build\GlyphVisualizer.exe GlyphVisualizer-$((Get-Content .version)) && windeployqt --release GlyphVisualizer-$((Get-Content .version))\GlyphVisualizer.exe | |
Compress-Archive -Path GlyphVisualizer-$((Get-Content .version)) -DestinationPath GlyphVisualizer-$((Get-Content .version))_windows-x64-portable.zip | |
if: matrix.os == 'windows-2022' | |
# Calculate checksum + upload (Windows) | |
- name: Calculate Checksum (Windows) | |
run: $(CertUtil -hashfile GlyphVisualizer-$((Get-Content .version))_windows-x64-portable.zip SHA256)[1] -replace ' ','' | tee GlyphVisualizer-$((Get-Content .version))_windows-x64-portable.zip.sha256.txt | |
if: matrix.os == 'windows-2022' | |
- name: Upload artifacts (Windows) | |
uses: actions/upload-artifact@v4 | |
if: matrix.os == 'windows-2022' | |
with: | |
name: GlyphVisualizer_windows-x64-portable | |
path: | | |
GlyphVisualizer*_windows-x64-portable.zip | |
GlyphVisualizer*_windows-x64-portable.zip.sha256.txt | |
# Package AppImage (Ubuntu) | |
- name: Download linuxdeploy tools (Ubuntu) | |
run: | | |
wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage | |
wget https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage | |
wget https://github.com/linuxdeploy/linuxdeploy-plugin-appimage/releases/download/continuous/linuxdeploy-plugin-appimage-x86_64.AppImage | |
chmod +x linuxdeploy-x86_64.AppImage | |
chmod +x linuxdeploy-plugin-qt-x86_64.AppImage | |
chmod +x linuxdeploy-plugin-appimage-x86_64.AppImage | |
sudo apt install -y libfuse2 libxcb-cursor0 | |
if: matrix.os == 'ubuntu-22.04' | |
- name: Package AppImage (Ubuntu) | |
run: LDAI_VERSION="$(cat .version)" LDAI_OUTPUT="GlyphVisualizer-$(cat .version)_linux-ubuntu-x64.AppImage" LDAI_UPDATE_INFORMATION="gh-releases-zsync|SebiAi|GlyphVisualizer|latest|GlyphVisualizer*_linux-ubuntu-x64.AppImage.zsync" ./linuxdeploy-x86_64.AppImage --executable "build/GlyphVisualizer" --desktop-file "deploy/linux/AppImage/com.sebiai.GlyphVisualizer.desktop" --icon-file "deploy/linux/AppImage/GlyphVisualizer.png" --plugin qt --appdir AppDir --output appimage | |
if: matrix.os == 'ubuntu-22.04' | |
# Calculate checksum + upload (Ubuntu) | |
- name: Calculate Checksum (Ubuntu) | |
run: sha256sum -b GlyphVisualizer-$(cat .version)_linux-ubuntu-x64.AppImage | tee GlyphVisualizer-$(cat .version)_linux-ubuntu-x64.AppImage.sha256 | |
if: matrix.os == 'ubuntu-22.04' | |
- name: Upload artifacts (Ubuntu) | |
uses: actions/upload-artifact@v4 | |
if: matrix.os == 'ubuntu-22.04' | |
with: | |
name: GlyphVisualizer_linux-ubuntu-x64 | |
path: | | |
GlyphVisualizer*_linux-ubuntu-x64.AppImage | |
GlyphVisualizer*_linux-ubuntu-x64.AppImage.zsync | |
GlyphVisualizer*_linux-ubuntu-x64.AppImage.sha256 | |
# Package with macdeployqt | |
- name: Use macdeployqt (macOS) | |
run: | | |
cd build && macdeployqt GlyphVisualizer.app -dmg && cd .. | |
if: matrix.os == 'macos-12' | |
# Calculate checksum + upload (macOS) | |
- name: Move and rename executable (macOS) | |
run: mv build/GlyphVisualizer.dmg GlyphVisualizer-$(cat .version)_macOS-12-x64.dmg | |
if: matrix.os == 'macos-12' | |
- name: Calculate Checksum (macOS) | |
run: shasum -a 256 -b GlyphVisualizer-$(cat .version)_macOS-12-x64.dmg | tee GlyphVisualizer-$(cat .version)_macOS-12-x64.dmg.sha256 | |
if: matrix.os == 'macos-12' | |
- name: Upload artifacts (macOS) | |
uses: actions/upload-artifact@v4 | |
if: matrix.os == 'macos-12' | |
with: | |
name: GlyphVisualizer_macOS-12-x64 | |
path: | | |
GlyphVisualizer*_macOS-12-x64.dmg | |
GlyphVisualizer*_macOS-12-x64.dmg.sha256 | |
create_release: | |
name: Create Release | |
needs: build | |
runs-on: ubuntu-22.04 | |
permissions: | |
contents: write | |
pull-requests: write | |
steps: | |
# Prepare | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Cache Node modules | |
uses: actions/cache@v3 | |
with: | |
path: node_modules | |
key: node-${{ runner.os }}-${{ hashFiles('package-lock.json') }} | |
- name: Install semantic-release | |
run: npm install | |
# Get artifacts | |
- name: Download artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
merge-multiple: true | |
# Create release | |
- name: Create Release with semantic-release | |
run: npx semantic-release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |