-
-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
628 additions
and
82 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,294 @@ | ||
name: Qt builds | ||
|
||
on: push | ||
|
||
env: | ||
BUILD_TYPE: Release | ||
|
||
jobs: | ||
build-linux-x86_64: | ||
runs-on: ubuntu-22.04 | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
|
||
- uses: dlang-community/setup-dlang@v1 | ||
with: | ||
compiler: ldc-1.33.0 | ||
|
||
- name: Install dependencies | ||
run: sudo apt-get update && sudo apt-get install -y libz-dev elfutils qtbase5-dev | ||
|
||
- name: Write version file | ||
run: echo 'module version_string; enum versionStr = "Sideloader automated build, branch ${{ github.ref_name }}, commit ${{ github.sha }}";' > source/version_string.d | ||
|
||
- name: Build | ||
run: dub build -b release-debug --compiler=ldc2 :qt-frontend | ||
|
||
- name: Rename | ||
run: mv "${{github.workspace}}/bin/sideloader" "${{github.workspace}}/bin/sideloader-x86_64" | ||
|
||
- name: Rename | ||
run: mv "${{github.workspace}}/bin/sideloader" "${{github.workspace}}/bin/sideloader-qt-linux-x86_64" | ||
|
||
- name: Put debug symbols in a separate file | ||
run: eu-strip --strip-debug -f "${{github.workspace}}/bin/sideloader-qt-linux-x86_64.dbg" "${{github.workspace}}/bin/sideloader-qt-linux-x86_64" | ||
|
||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: sideloader-qt-linux-x86_64 | ||
path: | | ||
${{github.workspace}}/bin/sideloader-qt-linux-x86_64 | ||
${{github.workspace}}/bin/sideloader-qt-linux-x86_64.dbg | ||
build-macos-x86_64: | ||
# if: false | ||
runs-on: ubuntu-22.04 | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Set up Homebrew | ||
id: set-up-homebrew | ||
uses: Homebrew/actions/setup-homebrew@master | ||
|
||
- name: Install Qt | ||
uses: jurplel/install-qt-action@v3 | ||
with: | ||
aqtversion: '==3.1.*' | ||
version: '5.15.2' | ||
host: 'mac' | ||
target: 'desktop' | ||
arch: 'clang_64' | ||
archives: 'qtbase' | ||
|
||
- uses: dlang-community/setup-dlang@v1 | ||
with: | ||
compiler: ldc-1.33.0 | ||
|
||
- name: Set-up macOS cross-compilation | ||
run: | | ||
mkdir -p $HOME/.ldc/ | ||
curl -LO https://github.com/phracker/MacOSX-SDKs/releases/download/11.3/MacOSX11.0.sdk.tar.xz | ||
tar -xf ./MacOSX11.0.sdk.tar.xz -C $HOME | ||
cat << EOF | tee $HOME/.ldc/ldc2.conf | ||
"x86_64-apple-darwin": | ||
{ | ||
// default switches injected before all explicit command-line switches | ||
switches = [ | ||
"-gcc=clang", | ||
"-linker=lld-15", | ||
"-Xcc=-target", | ||
"-Xcc=x86_64-apple-darwin", | ||
"-Xcc=-isysroot", | ||
"-Xcc=$HOME/MacOSX11.0.sdk", | ||
"-Xcc=-F", | ||
"-Xcc=$HOME/ldc2-1.33.0-osx-x86_64/lib", | ||
"-Xcc=-mmacosx-version-min=12.6", | ||
"-L=-platform_version", | ||
"-L=macos", | ||
"-L=12.6.0", | ||
"-L=0.0.0", | ||
"-defaultlib=phobos2-ldc,druntime-ldc", | ||
]; | ||
// default switches appended after all explicit command-line switches | ||
post-switches = [ | ||
"-I$HOME/ldc2-1.33.0-osx-x86_64/import", | ||
]; | ||
// default directories to be searched for libraries when linking | ||
lib-dirs = [ | ||
"$HOME/ldc2-1.33.0-osx-x86_64/lib", | ||
]; | ||
}; | ||
EOF | ||
mkdir $HOME/ldc-macos | ||
curl -LO https://github.com/ldc-developers/ldc/releases/download/v1.33.0/ldc2-1.33.0-osx-x86_64.tar.xz | ||
tar -xf ./ldc2-1.33.0-osx-x86_64.tar.xz -C $HOME | ||
brew fetch --force --bottle-tag=monterey llvm@16 | ||
brew install $(brew --cache --bottle-tag=monterey llvm@16) | ||
cp /home/linuxbrew/.linuxbrew/Cellar/llvm@16/16.0.6/lib/c++/* $HOME/ldc2-1.33.0-osx-x86_64/lib | ||
rm -rf /home/linuxbrew/.linuxbrew | ||
- name: Set-up Qt for cross-compilation | ||
run: | ||
cp -r $Qt5_DIR/lib/* $HOME/ldc2-1.33.0-osx-x86_64/lib | ||
|
||
- name: Install dependencies | ||
run: sudo apt-get update && sudo apt-get install -y libz-dev elfutils clang lld-15 | ||
|
||
- name: Write version file | ||
run: echo 'module version_string; enum versionStr = "Sideloader automated build, branch ${{ github.ref_name }}, commit ${{ github.sha }}";' > source/version_string.d | ||
|
||
- name: Build | ||
run: dub build -b release-debug --compiler=ldc2 --arch x86_64-apple-darwin :qt-frontend | ||
|
||
# - name: Rename | ||
# run: mv "${{github.workspace}}/bin/sideloader" "${{github.workspace}}/bin/sideloader-macOS-x86_64" | ||
|
||
- name: Build bundle | ||
run: | | ||
cp bin/sideloader ${{github.workspace}}/macos/resources/Sideloader.app/Contents/MacOS | ||
cp -r $Qt5_DIR/plugins ${{github.workspace}}/macos/resources/Sideloader.app/Contents/ | ||
cp -r $Qt5_DIR/lib/Qt{Core,Gui,Widgets,DBus,PrintSupport}.framework ${{github.workspace}}/macos/resources/Sideloader.app/Contents/Frameworks | ||
rm -rf ${{github.workspace}}/macos/resources/Sideloader.app/Contents/Frameworks/Qt{Core,Gui,Widgets,DBus,PrintSupport}.framework/Versions/5/Headers/ | ||
tar -czpvf Sideloader-qt.app.tgz -C ${{github.workspace}}/macos/resources/ Sideloader.app | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: sideloader-macOS-x86_64 | ||
path: | | ||
${{github.workspace}}/Sideloader-qt.app.tgz | ||
build-macos-arm64: | ||
# if: false | ||
runs-on: ubuntu-22.04 | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
|
||
- uses: dlang-community/setup-dlang@v1 | ||
with: | ||
compiler: ldc-1.33.0 | ||
|
||
- name: Set up Homebrew | ||
id: set-up-homebrew | ||
uses: Homebrew/actions/setup-homebrew@master | ||
|
||
- name: Install Qt | ||
uses: jurplel/install-qt-action@v3 | ||
with: | ||
aqtversion: '==3.1.*' | ||
version: '5.15.2' | ||
host: 'mac' | ||
target: 'desktop' | ||
arch: 'clang_64' | ||
archives: 'qtbase' | ||
|
||
- name: Set-up macOS cross-compilation | ||
run: | | ||
mkdir -p $HOME/.ldc/ | ||
curl -LO https://github.com/phracker/MacOSX-SDKs/releases/download/11.3/MacOSX11.0.sdk.tar.xz | ||
tar -xf ./MacOSX11.0.sdk.tar.xz -C $HOME | ||
cat << EOF | tee $HOME/.ldc/ldc2.conf | ||
"arm64-apple-macos": | ||
{ | ||
// default switches injected before all explicit command-line switches | ||
switches = [ | ||
"-gcc=clang", | ||
"-linker=lld-15", | ||
"-Xcc=-target", | ||
"-Xcc=arm64-apple-macos", | ||
"-Xcc=-isysroot", | ||
"-Xcc=$HOME/MacOSX11.0.sdk", | ||
"-Xcc=-F", | ||
"-Xcc=$HOME/ldc2-1.33.0-osx-arm64/lib", | ||
"-Xcc=-mmacosx-version-min=12.6", | ||
"-L=-platform_version", | ||
"-L=macos", | ||
"-L=12.6.0", | ||
"-L=0.0.0", | ||
"-defaultlib=phobos2-ldc,druntime-ldc", | ||
]; | ||
// default switches appended after all explicit command-line switches | ||
post-switches = [ | ||
"-I$HOME/ldc2-1.33.0-osx-arm64/import", | ||
]; | ||
// default directories to be searched for libraries when linking | ||
lib-dirs = [ | ||
"$HOME/ldc2-1.33.0-osx-arm64/lib", | ||
]; | ||
}; | ||
EOF | ||
mkdir $HOME/ldc-macos | ||
curl -LO https://github.com/ldc-developers/ldc/releases/download/v1.33.0/ldc2-1.33.0-osx-arm64.tar.xz | ||
tar -xf ./ldc2-1.33.0-osx-arm64.tar.xz -C $HOME | ||
brew fetch --force --bottle-tag=arm64_monterey llvm@16 | ||
brew install $(brew --cache --bottle-tag=arm64_monterey llvm@16) | ||
cp /home/linuxbrew/.linuxbrew/Cellar/llvm@16/16.0.6/lib/c++/* $HOME/ldc2-1.33.0-osx-arm64/lib | ||
rm -rf /home/linuxbrew/.linuxbrew | ||
- name: Set-up Qt for cross-compilation | ||
run: | ||
cp -r $Qt5_DIR/lib/* $HOME/ldc2-1.33.0-osx-arm64/lib | ||
|
||
- name: Install dependencies | ||
run: sudo apt-get update && sudo apt-get install -y libz-dev elfutils clang lld-15 | ||
|
||
- name: Write version file | ||
run: echo 'module version_string; enum versionStr = "Sideloader automated build, branch ${{ github.ref_name }}, commit ${{ github.sha }}";' > source/version_string.d | ||
|
||
- name: Build | ||
run: dub build -b release-debug --compiler=ldc2 --arch arm64-apple-macos :qt-frontend | ||
|
||
# - name: Rename | ||
# run: mv "${{github.workspace}}/bin/sideloader" "${{github.workspace}}/bin/sideloader-macOS-arm64" | ||
|
||
- name: Build bundle | ||
run: | | ||
cp bin/sideloader ${{github.workspace}}/macos/resources/Sideloader.app/Contents/MacOS | ||
cp -r $Qt5_DIR/plugins ${{github.workspace}}/macos/resources/Sideloader.app/Contents/ | ||
cp -r $Qt5_DIR/lib/Qt{Core,Gui,Widgets,DBus,PrintSupport}.framework ${{github.workspace}}/macos/resources/Sideloader.app/Contents/Frameworks | ||
rm -rf ${{github.workspace}}/macos/resources/Sideloader.app/Contents/Frameworks/Qt{Core,Gui,Widgets,DBus,PrintSupport}.framework/Versions/5/Headers/ | ||
tar -czpvf Sideloader-qt.app.tgz -C ${{github.workspace}}/macos/resources/ Sideloader.app | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: sideloader-macOS-arm64 | ||
path: | | ||
${{github.workspace}}/Sideloader-qt.app.tgz | ||
build-windows-x86_64: | ||
runs-on: windows-2019 | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
|
||
- uses: TheMrMilchmann/setup-msvc-dev@v3 | ||
with: | ||
toolset: 14.0 | ||
arch: x64 | ||
|
||
- uses: dlang-community/setup-dlang@v1 | ||
with: | ||
compiler: ldc-1.33.0 | ||
|
||
- name: Install Qt | ||
uses: jurplel/install-qt-action@v3 | ||
with: | ||
aqtversion: '==3.1.*' | ||
version: '5.15.2' | ||
host: 'windows' | ||
target: 'desktop' | ||
dir: '${{github.workspace}}/qt/' | ||
arch: 'win64_msvc2015_64' | ||
archives: 'qtbase' | ||
|
||
- name: Write version file | ||
run: echo 'module version_string; enum versionStr = "Sideloader automated build, branch ${{ github.ref_name }}, commit ${{ github.sha }}";' > source/version_string.d | ||
|
||
- name: Build | ||
run: | | ||
$env:LIB += ';' + $env:Qt5_Dir + '\lib' | ||
echo $env:LIB | ||
dub build -b release-debug --compiler=ldc2 :qt-frontend | ||
- name: Rename | ||
run: | | ||
mkdir "${{github.workspace}}/bin/platforms" | ||
Copy-Item ($env:Qt5_DIR + '/plugins/platforms/qwindows.dll') "${{github.workspace}}/bin/platforms" | ||
Copy-Item ($env:Qt5_DIR + '/bin/Qt5Core.dll'),($env:Qt5_DIR + '/bin/Qt5Gui.dll'),($env:Qt5_DIR + '/bin/Qt5Widgets.dll') "${{github.workspace}}/bin" | ||
Compress-Archive -Path bin/* -DestinationPath sideloader-qt-windows.zip | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: sideloader-windows-x86_64 | ||
path: | | ||
${{github.workspace}}/sideloader-qt-windows.zip |
Oops, something went wrong.