mirror of
https://github.com/zealdocs/zeal.git
synced 2026-08-29 16:40:51 +08:00
246 lines
7.7 KiB
YAML
246 lines
7.7 KiB
YAML
name: Release
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- "v*.*.*"
|
|
|
|
permissions: {}
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}
|
|
cancel-in-progress: false
|
|
|
|
jobs:
|
|
build-windows:
|
|
name: ${{ matrix.config.name }}
|
|
runs-on: ${{ matrix.config.os }}
|
|
permissions:
|
|
contents: write
|
|
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
config:
|
|
- name: Windows Server 2022
|
|
os: windows-2022
|
|
arch: win64_msvc2022_64
|
|
qt_modules: >-
|
|
qtpositioning
|
|
qtwebchannel
|
|
qtwebengine
|
|
qt_version: "6.10.2"
|
|
configurePreset: release
|
|
buildPreset: release
|
|
uploadPattern: "zeal-*-windows-x64.msi"
|
|
- name: Windows Server 2022 / Portable
|
|
os: windows-2022
|
|
arch: win64_msvc2022_64
|
|
qt_modules: >-
|
|
qtpositioning
|
|
qtwebchannel
|
|
qtwebengine
|
|
qt_version: "6.10.2"
|
|
configurePreset: release-portable
|
|
buildPreset: release-portable
|
|
uploadPattern: "zeal-*-portable-windows-x64.*"
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v6
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Prepare vcpkg
|
|
uses: lukka/run-vcpkg@v11
|
|
with:
|
|
vcpkgDirectory: ${{ github.workspace }}/.vcpkg
|
|
|
|
- name: Install Qt
|
|
uses: jurplel/install-qt-action@v4
|
|
with:
|
|
arch: ${{ matrix.config.arch }}
|
|
modules: ${{ matrix.config.qt_modules }}
|
|
version: ${{ matrix.config.qt_version }}
|
|
cache: true
|
|
|
|
- name: Configure & Build
|
|
uses: lukka/run-cmake@v10
|
|
with:
|
|
configurePreset: ${{ matrix.config.configurePreset }}
|
|
buildPreset: ${{ matrix.config.buildPreset }}
|
|
configurePresetAdditionalArgs: "['-DVCPKG_DISABLE_COMPILER_TRACKING=ON']"
|
|
|
|
- name: Retrieve Application Version
|
|
run: |
|
|
$zeal_version = Get-Content build/${{ matrix.config.configurePreset }}/zeal_version
|
|
Write-Output "Zeal Version: $zeal_version"
|
|
"ZEAL_VERSION=$zeal_version" >> $env:GITHUB_ENV
|
|
|
|
- name: Install WiX
|
|
if: matrix.config.configurePreset == 'release'
|
|
run: |
|
|
dotnet tool install --global wix --version 5.0.2
|
|
wix extension add --global WixToolset.UI.wixext/5.0.2
|
|
wix extension add --global WixToolset.Util.wixext/5.0.2
|
|
|
|
- name: Package
|
|
run: cmake --build --preset ${{ matrix.config.buildPreset }} --target package
|
|
env:
|
|
CODESIGN_CERTIFICATE_BASE64: ${{ secrets.CODESIGN_CERTIFICATE_BASE64 }}
|
|
CODESIGN_PASSWORD: ${{ secrets.CODESIGN_PASSWORD }}
|
|
|
|
- name: Upload Release Assets
|
|
run: |
|
|
gh release upload ${{ github.ref_name }} --clobber `
|
|
build/${{ matrix.config.configurePreset }}/${{ matrix.config.uploadPattern }}
|
|
env:
|
|
GH_TOKEN: ${{ github.token }}
|
|
|
|
build-appimage:
|
|
name: AppImage
|
|
runs-on: ubuntu-24.04
|
|
permissions:
|
|
contents: write
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v6
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Install Dependencies
|
|
run: |
|
|
sudo apt-get -y -qq update
|
|
sudo apt-get -y -qq --no-install-recommends install \
|
|
appstream \
|
|
cmake \
|
|
extra-cmake-modules \
|
|
libarchive-dev \
|
|
libfuse2t64 \
|
|
libgl1-mesa-dev \
|
|
libqt6opengl6-dev \
|
|
libsqlite3-dev \
|
|
libvulkan-dev \
|
|
libxcb-keysyms1-dev \
|
|
ninja-build \
|
|
qt6-base-private-dev \
|
|
qt6-webengine-dev \
|
|
qt6-webengine-dev-tools
|
|
|
|
- name: Install linuxdeploy
|
|
run: |
|
|
wget -q https://github.com/linuxdeploy/linuxdeploy/releases/download/1-alpha-20251107-1/linuxdeploy-x86_64.AppImage
|
|
wget -q https://github.com/linuxdeploy/linuxdeploy-plugin-appimage/releases/download/1-alpha-20250213-1/linuxdeploy-plugin-appimage-x86_64.AppImage
|
|
wget -q https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/1-alpha-20250213-1/linuxdeploy-plugin-qt-x86_64.AppImage
|
|
chmod +x linuxdeploy*.AppImage
|
|
|
|
- name: Configure & Build
|
|
run: |
|
|
cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=/usr
|
|
cmake --build build
|
|
|
|
- name: Retrieve Application Version
|
|
run: |
|
|
zeal_version=$(<build/zeal_version)
|
|
echo "Zeal Version: ${zeal_version}"
|
|
echo "ZEAL_VERSION=${zeal_version}" >> $GITHUB_ENV
|
|
|
|
- name: Prepare AppDir
|
|
run: DESTDIR=${{ github.workspace }}/AppDir cmake --install build
|
|
|
|
- name: Validate AppStream Metadata
|
|
run: appstreamcli validate AppDir/usr/share/metainfo/org.zealdocs.zeal.appdata.xml
|
|
|
|
- name: Set Up AppRun Hooks
|
|
run: |
|
|
mkdir -p AppDir/apprun-hooks
|
|
echo 'export QTWEBENGINE_DISABLE_SANDBOX=1' > AppDir/apprun-hooks/qtwebengine.sh
|
|
|
|
- name: Build AppImage
|
|
run: |
|
|
export QMAKE=$(which qmake6)
|
|
export OUTPUT=Zeal-${{ env.ZEAL_VERSION }}-x86_64.AppImage
|
|
export LDAI_UPDATE_INFORMATION="gh-releases-zsync|zealdocs|zeal|latest|Zeal-*x86_64.AppImage.zsync"
|
|
./linuxdeploy-x86_64.AppImage \
|
|
--appdir AppDir \
|
|
--plugin qt \
|
|
--output appimage
|
|
|
|
- name: Upload Release Assets
|
|
run: gh release upload ${{ github.ref_name }} --clobber Zeal-*.AppImage*
|
|
env:
|
|
GH_TOKEN: ${{ github.token }}
|
|
|
|
build-ubuntu:
|
|
name: ${{ matrix.config.name }}
|
|
runs-on: ${{ matrix.config.os }}
|
|
permissions:
|
|
contents: write
|
|
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
config:
|
|
- name: Ubuntu 24.04 / Source
|
|
os: ubuntu-24.04
|
|
qt_packages: >-
|
|
libgl1-mesa-dev
|
|
libqt6opengl6-dev
|
|
qt6-base-private-dev
|
|
qt6-webengine-dev
|
|
qt6-webengine-dev-tools
|
|
configurePreset: release
|
|
buildPreset: release
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v6
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Install Dependencies
|
|
run: |
|
|
sudo apt-get -y -qq update
|
|
sudo apt-get -y -qq --no-install-recommends install \
|
|
cmake \
|
|
extra-cmake-modules \
|
|
libarchive-dev \
|
|
libsqlite3-dev \
|
|
libvulkan-dev \
|
|
libxcb-keysyms1-dev \
|
|
ninja-build \
|
|
${{ matrix.config.qt_packages }}
|
|
|
|
- name: Configure & Package Source
|
|
uses: lukka/run-cmake@v10
|
|
with:
|
|
configurePreset: ${{ matrix.config.configurePreset }}
|
|
buildPreset: ${{ matrix.config.buildPreset }}
|
|
buildPresetAdditionalArgs: "['--target package_source']"
|
|
|
|
- name: Upload Release Assets
|
|
run: gh release upload ${{ github.ref_name }} --clobber build/${{ matrix.config.configurePreset }}/zeal-*.*
|
|
env:
|
|
GH_TOKEN: ${{ github.token }}
|
|
|
|
publish:
|
|
name: Publish Release
|
|
needs: [build-windows, build-appimage, build-ubuntu]
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Generate App Token
|
|
id: app-token
|
|
if: github.repository == 'zealdocs/zeal'
|
|
uses: actions/create-github-app-token@v3
|
|
with:
|
|
client-id: ${{ secrets.CI_APP_ID }}
|
|
private-key: ${{ secrets.CI_APP_PRIVATE_KEY }}
|
|
permission-contents: write
|
|
|
|
- name: Publish Release
|
|
run: gh release edit ${{ github.ref_name }} --draft=false --discussion-category Announcements --repo ${{ github.repository }}
|
|
env:
|
|
GH_TOKEN: ${{ steps.app-token.outputs.token || github.token }}
|