ci #631
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: CI | |
on: | |
push: | |
paths: | |
- "*.pro" | |
- "package/**" | |
- "src/**" | |
- ".github/workflows/ci.yml" | |
pull_request: | |
paths: | |
- "*.pro" | |
- "package/**" | |
- "src/**" | |
- ".github/workflows/ci.yml" | |
jobs: | |
create-release: | |
if: ${{ !startsWith(github.event.ref, 'refs/tags/') }} | |
name: Create Pre-Release | |
runs-on: ubuntu-latest | |
needs: | |
- build-on-ubuntu | |
- build-on-win-mingw | |
- build-on-osx | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 1 | |
submodules: recursive | |
- name: Set Env | |
shell: bash | |
run: | | |
export VERSION=$(grep -o '".*"' src/version.h | sed 's/"//g')-build.$GITHUB_RUN_NUMBER | |
echo "VERSION=${VERSION}" >> $GITHUB_ENV | |
- name: Download artifacts | |
uses: actions/download-artifact@v2 | |
with: | |
path: etc/usr/artifacts/ | |
- name: Process artifacts | |
run: | | |
mkdir -p /home/runner/work/modmanager/modmanager/etc/usr/publish | |
cd /home/runner/work/modmanager/modmanager/etc/usr/artifacts/ModManager-${{ env.VERSION }}-x64-packed | |
zip -q -r ModManager-${{ env.VERSION }}-x64-packed.zip * | |
mv ModManager-${{ env.VERSION }}-x64-packed.zip /home/runner/work/modmanager/modmanager/etc/usr/publish/ModManager-${{ env.VERSION }}-x64-packed.zip | |
mv /home/runner/work/modmanager/modmanager/etc/usr/artifacts/ModManager-${{ env.VERSION }}-x64-Installer.exe/ModManager-Installer.exe /home/runner/work/modmanager/modmanager/etc/usr/publish/ModManager-${{ env.VERSION }}-x64-Installer.exe | |
# mv /home/runner/work/modmanager/modmanager/etc/usr/artifacts/ModManager-${{ env.VERSION }}.dmg/modmanager.dmg /home/runner/work/modmanager/modmanager/etc/usr/publish/ModManager-${{ env.VERSION }}.dmg | |
mv /home/runner/work/modmanager/modmanager/etc/usr/artifacts/ModManager-${{ env.VERSION }}-x86_64.AppImage/Mod_Manager-${{ env.VERSION }}-x86_64.AppImage /home/runner/work/modmanager/modmanager/etc/usr/publish/ModManager-${{ env.VERSION }}.AppImage | |
- name: Get short commit sha | |
id: get_short_sha | |
run: | | |
short_sha=$(echo ${GITHUB_SHA} | cut -c1-7) | |
echo "::set-output name=short_sha::$short_sha" | |
- name: Create Github release | |
uses: marvinpinto/action-automatic-releases@v1.2.1 | |
with: | |
repo_token: "${{ secrets.GITHUB_TOKEN }}" | |
automatic_release_tag: "${{ env.VERSION }}" | |
prerelease: true | |
title: "Mod Manager Dev ${{ env.VERSION }} (${{ steps.get_short_sha.outputs.short_sha }})" | |
files: | | |
etc/usr/publish/** | |
build-on-ubuntu: | |
name: Build On Ubuntu | |
runs-on: ubuntu-24.04 # for libquazip1-qt5 available | |
steps: | |
- name: Install Qt | |
uses: jurplel/install-qt-action@v4 | |
with: | |
version: 5.15.2 | |
modules: qtwebengine | |
- name: ubuntu install packages | |
run: | | |
sudo apt update | |
sudo apt-get install -y libglew-dev libglfw3-dev | |
sudo apt-get install -y libaria2-0-dev libquazip1-qt5-dev | |
sudo apt install -y libgl-dev libx11-dev libxkbcommon-x11-dev libxcb-util1 libxcb-image0-dev libxcb-icccm4-dev libssl-dev libxcb-keysyms1 libxcb-render-util0 libxcb-xinerama0 | |
sudo apt install -y libprotobuf-dev protobuf-compiler protobuf-c-compiler libgrpc++-dev protobuf-compiler-grpc ninja-build fcitx-frontend-qt5 libcurl4-openssl-dev | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 1 | |
- name: Set Env | |
run: | | |
export ARCH=x86_64 | |
export RAW_VERSION=$(grep -o '".*"' src/version.h | sed 's/"//g') | |
export VERSION=$RAW_VERSION-build.$GITHUB_RUN_NUMBER | |
export RELEASE_TEXT=$(grep -Pzo "### ${VERSION}\n(\n|.)+?\n##" Changelog.md | sed '$ d') | |
echo "RAW_VERSION=${RAW_VERSION}" >> $GITHUB_ENV | |
echo "VERSION=${VERSION}" >> $GITHUB_ENV | |
echo "RELEASE_TEXT<<EOF" >> $GITHUB_ENV | |
echo "${RELEASE_TEXT}" >> $GITHUB_ENV | |
echo "EOF" >> $GITHUB_ENV | |
- name: Modify version number | |
if: ${{ !startsWith(github.event.ref, 'refs/tags/') }} | |
shell: bash | |
run: | | |
sed -i "s/$RAW_VERSION/$VERSION/" src/version.h | |
- name: build ubuntu | |
run: | | |
export PKG_CONFIG_PATH='/usr/lib/x86_64-linux-gnu/pkgconfig/' | |
qmake | |
make | |
- name: package | |
run: | | |
make INSTALL_ROOT=AppDir -j2 install ; find AppDir/ | |
wget -c -nv https://github.com/$(wget -q https://github.com/probonopd/go-appimage/releases/expanded_assets/continuous -O - | grep "appimagetool-.*-x86_64.AppImage" | head -n 1 | cut -d '"' -f 2) #Thanks to github page change. | |
chmod +x appimagetool-*.AppImage | |
sudo mkdir -p /home/qt/work/install | |
sudo ln -s $QT_PLUGIN_PATH /home/qt/work/install/plugins | |
./appimagetool-*.AppImage -s deploy AppDir/usr/share/applications/*.desktop | |
./appimagetool-*.AppImage AppDir | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: ModManager-${{ env.VERSION }}-x86_64.AppImage | |
path: Mod_Manager*.AppImage | |
- name: uploadRelease | |
if: startsWith(github.event.ref, 'refs/tags/') | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: Mod_Manager-${{ env.VERSION }}-x86_64.AppImage | |
asset_name: ModManager-${{ env.VERSION }}-x86_64.AppImage | |
tag: ${{ github.ref }} | |
body: ${{ env.RELEASE_TEXT }} | |
overwrite: true | |
build-on-win-mingw: | |
name: Build On Windows Mingw | |
runs-on: windows-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
# - qt_arch: win64_mingw | |
# qt_ver: 6.7.1 | |
# modules: qt5compat | |
- qt_arch: win64_mingw81 | |
qt_ver: 5.15.2 | |
qt_tools_mingw_install: mingw810_64 | |
modules: | |
steps: | |
- name: Install Qt | |
uses: jurplel/install-qt-action@v4 | |
with: | |
host: 'windows' | |
target: 'desktop' | |
version: ${{ matrix.qt_ver }} | |
arch: ${{ matrix.qt_arch }} | |
modules: ${{ matrix.modules }} | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 1 | |
submodules: recursive | |
- name: Set Env | |
shell: bash | |
run: | | |
export RAW_VERSION=$(grep -o '".*"' src/version.h | sed 's/"//g') | |
export VERSION=$RAW_VERSION-build.$GITHUB_RUN_NUMBER | |
echo "RAW_VERSION=${RAW_VERSION}" >> $GITHUB_ENV | |
echo "VERSION=${VERSION}" >> $GITHUB_ENV | |
- name: Modify version number | |
if: ${{ !startsWith(github.event.ref, 'refs/tags/') }} | |
shell: bash | |
run: | | |
sed -i "s/$RAW_VERSION/$VERSION/" src/version.h | |
- name: Install dependencies for Qt 5 | |
if: ${{ startsWith( matrix.qt_ver, 5 ) }} | |
shell: powershell | |
run: | | |
C:/msys64/usr/bin/pacman -S mingw-w64-x86_64-aria2 --noconfirm | |
C:/msys64/usr/bin/pacman -S mingw-w64-x86_64-quazip-qt5 --noconfirm | |
C:/msys64/usr/bin/pacman -S mingw-w64-x86_64-pkg-config --noconfirm | |
C:/msys64/usr/bin/pacman -Q | |
- name: Install dependencies for Qt 6 | |
if: ${{ startsWith( matrix.qt_ver, 6 ) }} | |
shell: powershell | |
run: | | |
C:/msys64/usr/bin/pacman -S mingw-w64-x86_64-aria2 --noconfirm | |
C:/msys64/usr/bin/pacman -S mingw-w64-x86_64-quazip-qt6 --noconfirm | |
C:/msys64/usr/bin/pacman -S mingw-w64-x86_64-pkg-config --noconfirm | |
- name: environment configuration | |
shell: pwsh | |
run: | | |
Write-Output "${{ env.QT_ROOT_DIR }}/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append | |
Write-Output "${{ env.QT_ROOT_DIR }}/../../Tools/${{ matrix.qt_tools_mingw_install }}/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append | |
- name: where is qmake & where is mingw32-make | |
shell: pwsh | |
run: | | |
Get-Command -Name 'qmake' | Format-List | |
Get-Command -Name 'mingw32-make' | Format-List | |
- name: mingw-build | |
id: build | |
shell: pwsh | |
env: | |
PKG_CONFIG_PATH: 'C:/msys64/mingw64/lib/pkgconfig' | |
run: | | |
cp C:/msys64/mingw64/bin/pkg-config.exe ${{ env.QT_ROOT_DIR }}/bin/ | |
qmake | |
mingw32-make.exe qmake_all | |
mingw32-make.exe | |
- name: list msys dll | |
shell: pwsh | |
run : | | |
ls C:/msys64/mingw64/bin | |
ls ${{ env.QT_ROOT_DIR }}/bin | |
- name: package | |
id: package | |
shell: pwsh | |
run: | | |
mkdir deploy | |
mv release/modmanager.exe deploy | |
cp C:/msys64/mingw64/bin/libcrypto-3-x64.dll deploy/ | |
cp C:/msys64/mingw64/bin/libbz2-1.dll deploy/ | |
cp C:/msys64/mingw64/bin/libiconv-2.dll deploy/ | |
cp C:/msys64/mingw64/bin/liblzma-5.dll deploy/ | |
cp C:/msys64/mingw64/bin/libintl-8.dll deploy/ | |
cp C:/msys64/mingw64/bin/zlib1.dll deploy/ | |
cp C:/msys64/mingw64/bin/libstdc++-6.dll deploy/ | |
cp C:/msys64/mingw64/bin/libsqlite3-0.dll deploy/ | |
cp C:/msys64/mingw64/bin/libssh2-1.dll deploy/ | |
cp C:/msys64/mingw64/bin/libxml2-2.dll deploy/ | |
cp C:/msys64/mingw64/bin/libgcc_s_seh-1.dll deploy/ | |
windeployqt.exe --no-translations --no-opengl-sw --no-system-d3d-compiler --no-quick-import --qmldir "${{ env.QT_ROOT_DIR }}/qml" deploy/modmanager.exe | |
- name: aria2 dependencies | |
shell: pwsh | |
run: | | |
iwr "https://github.com/kaniol-lck/modmanager/releases/download/v1.1.1-build.543/ModManager-v1.1.1-build.543-x64-packed.zip" -OutFile ModManager-v1.1.1-build.543-x64-packed.zip | |
unzip *.zip -d old | |
cp old/libaria2-0.dll deploy/ | |
cp old/libcares-5.dll deploy/ | |
cp old/libcrypto-1_1-x64.dll deploy/ | |
cp old/libssl-1_1-x64.dll deploy/ | |
- name: qt5 dependencies | |
if: ${{ startsWith( matrix.qt_ver, 5 ) }} | |
run : | | |
cp C:/msys64/mingw64/bin/libquazip1-qt5.dll deploy/ | |
# - name: qt6 dependencies | |
# if: ${{ startsWith( matrix.qt_ver, 6 ) }} | |
# run : | | |
# cp C:/msys64/mingw64/bin/libquazip1-qt6.dll deploy/ | |
# cp C:/msys64/mingw64/bin/libicuuc74.dll deploy/ | |
# cp C:/msys64/mingw64/bin/libicudt74.dll deploy/ | |
# cp C:/msys64/mingw64/bin/Qt6Core5Compat.dll deploy/ | |
- name: Modify NSIS for x64 | |
shell: pwsh | |
run: | | |
(Get-Content package/modmanager.nsi).replace('PROGRAMFILES', 'PROGRAMFILES64') | Set-Content package/modmanager.nsi | |
- name: Create installer | |
run: | | |
makensis package/modmanager.nsi | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: ModManager-${{ env.VERSION }}-x64-Installer.exe | |
path: ${{github.workspace}}/package/ModManager*-Installer.exe | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: ModManager-${{ env.VERSION }}-x64-packed | |
path: deploy/* | |
- name: Upload Release | |
if: startsWith(github.event.ref, 'refs/tags/') | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: package/ModManager-Installer.exe | |
asset_name: ModManager-${{ env.VERSION }}-x64-Installer.exe | |
tag: ${{ github.ref }} | |
overwrite: true | |
build-on-osx: | |
name: Build On OSX | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [macOS-13] | |
qt_ver: [6.7.1] | |
qt_arch: [clang_64] | |
steps: | |
- name: Install Qt | |
uses: jurplel/install-qt-action@v4 | |
with: | |
version: ${{ matrix.qt_ver }} | |
host: 'mac' | |
target: 'desktop' | |
arch: ${{ matrix.qt_arch }} | |
modules: 'qt5compat' | |
- name: Install libaria2 | |
run: | | |
wget "https://github.com/kaniol-lck/aria2/releases/download/release-1.36.0/libaria2-clang-macos-10.15.zip" | |
unzip *.zip | |
csrutil status | |
sudo cp -r lib/ /usr/local/lib/ | |
sudo cp -r include/aria2/ /usr/local/include/ | |
rm -rf lib/ include/ *.zip | |
- name: Install dependencies | |
run: | | |
brew install quazip gnu-sed aria2 | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 1 | |
- name: Set Env | |
shell: bash | |
run: | | |
export RAW_VERSION=$(grep -o '".*"' src/version.h | sed 's/"//g') | |
export VERSION=$RAW_VERSION-build.$GITHUB_RUN_NUMBER | |
echo "RAW_VERSION=${RAW_VERSION}" >> $GITHUB_ENV | |
echo "VERSION=${VERSION}" >> $GITHUB_ENV | |
- name: Modify version number | |
if: ${{ !startsWith(github.event.ref, 'refs/tags/') }} | |
shell: bash | |
run: | | |
gsed -i "s/$RAW_VERSION/$VERSION/" src/version.h | |
- name: build macos | |
run: | | |
qmake | |
make | |
- name: package | |
run: | | |
macdeployqt modmanager.app -qmldir=. -verbose=1 -dmg | |
shell: sh | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: ModManager-${{ env.VERSION }}.dmg | |
path: modmanager.dmg | |
- name: uploadRelease | |
if: startsWith(github.event.ref, 'refs/tags/') | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: modmanager.dmg | |
asset_name: ModManager-${{ env.VERSION }}.dmg | |
tag: ${{ github.ref }} | |
overwrite: true |