fix build with MinGW on GitHub Actions #243
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: Build | |
on: [push] | |
env: | |
WINDOWS_BASEKIT_URL: https:/registrationcenter-download.intel.com/akdlm/IRC_NAS/c961e083-5685-4f0b-ada5-c6cf16f561dd/w_BaseKit_p_2023.1.0.47256_offline.exe | |
WINDOWS_HPCKIT_URL: https:/registrationcenter-download.intel.com/akdlm/IRC_NAS/2a13d966-fcc5-4a66-9fcc-50603820e0c9/w_HPCKit_p_2023.1.0.46357_offline.exe | |
WINDOWS_CPP_COMPONENTS: intel.oneapi.win.cpp-compiler | |
WINDOWS_DPCPP_COMPONENTS: intel.oneapi.win.dpcpp-compiler | |
COMPILER_VERSION: 2023.1.0 | |
jobs: | |
Linux: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
include: | |
- GOARCH: amd64 | |
GOOS: linux | |
LIBPATH: x86_64-linux-gnu | |
env: | |
go_version: 1.20.6 | |
steps: | |
- name: Set up Go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: ${{ env.go_version }} | |
id: go | |
- run: go version && go env | |
- name: Check out code into the Go module directory | |
uses: actions/checkout@v2 | |
with: | |
ref: master | |
- name: Build Go executables | |
run: | | |
sudo apt-get update -y | |
sudo apt-get install -y pkg-config | |
mkdir -p ${{ matrix.GOOS }}-${{ matrix.GOARCH }} | |
make | |
cp $PWD/output/bass/lib/${{ matrix.GOOS }}/${{ matrix.GOARCH }}/libbass.so $PWD/${{ matrix.GOOS }}-${{ matrix.GOARCH }}/ | |
cp $PWD/output/bass/lib/${{ matrix.GOOS }}/${{ matrix.GOARCH }}/plugins/*.so $PWD/${{ matrix.GOOS }}-${{ matrix.GOARCH }}/ | |
cp $PWD/cmd/hannah/hannah $PWD/${{ matrix.GOOS }}-${{ matrix.GOARCH }}/ | |
cp $PWD/cmd/reverseProxy/rp $PWD/${{ matrix.GOOS }}-${{ matrix.GOARCH }}/ | |
- name: package Chrome extension | |
run: | | |
cd browser/chrome | |
zip ../../${{ matrix.GOOS }}-${{ matrix.GOARCH }}/hannah.crx ./* | |
cd ../.. | |
- name: package Firefox extension | |
run: | | |
cd browser/firefox | |
zip ../../${{ matrix.GOOS }}-${{ matrix.GOARCH }}/hannah.xpi ./* | |
cd ../.. | |
- name: Upload artifact hannah-${{ matrix.GOOS }}-${{ matrix.GOARCH }} | |
uses: actions/upload-artifact@v1.0.0 | |
with: | |
name: hannah-${{ matrix.GOOS }}-${{ matrix.GOARCH }} | |
path: ${{ matrix.GOOS }}-${{ matrix.GOARCH }} | |
Windows-MSVC: | |
runs-on: windows-latest | |
strategy: | |
matrix: | |
include: | |
- qt_arch: win64_msvc2019_64 | |
qt_ver: 5.15.2 | |
qt_modules: "" | |
mingw_arch: MINGW64 | |
mingw_prefix: mingw-w64-x86_64 | |
toolchains: gcc | |
GOARCH: amd64 | |
BUILDRP: build-x64.bat | |
msvc_arch: x64 | |
- qt_arch: win64_msvc2019_64 | |
qt_ver: 6.5.1 | |
qt_modules: "qt5compat qtimageformats" | |
mingw_arch: MINGW64 | |
mingw_prefix: mingw-w64-x86_64 | |
toolchains: gcc | |
GOARCH: amd64 | |
BUILDRP: build-x64.bat | |
msvc_arch: x64 | |
- qt_arch: win32_msvc2019 | |
qt_ver: 5.15.2 | |
qt_modules: "" | |
mingw_arch: MINGW32 | |
mingw_prefix: mingw-w64-i686 | |
toolchains: gcc | |
GOARCH: 386 | |
BUILDRP: build-x86.bat | |
msvc_arch: x86 | |
env: | |
go_version: 1.20.6 | |
qt_target: desktop | |
steps: | |
- uses: msys2/setup-msys2@v2 | |
with: | |
update: true | |
msystem: ${{ matrix.mingw_arch }} | |
install: zip make git ${{ matrix.mingw_prefix }}-${{ matrix.toolchains }} ${{ matrix.mingw_prefix }}-make ${{ matrix.mingw_prefix }}-zstd | |
- name: Set up Go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: ${{ env.go_version }} | |
id: go | |
- run: go version && go env | |
- name: Check out code into the Go module directory | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 1 | |
ref: ${{ github.head_ref }} | |
- name: Build Go executables | |
shell: msys2 {0} | |
run: | | |
env GOARCH=${{ matrix.GOARCH }} PATH=/${{ matrix.mingw_arch }}/bin:$PATH:/C/hostedtoolcache/windows/go/${{ env.go_version }}/x64/bin make | |
cd lib/reverseProxy | |
./update-def.sh | |
cd ../.. | |
mkdir -p ${{ matrix.qt_arch }}/cui | |
cp $PWD/output/bass/lib/windows/${{ matrix.GOARCH }}/bass.dll $PWD/${{ matrix.qt_arch }}/cui/ | |
cp $PWD/output/bass/lib/windows/${{ matrix.GOARCH }}/plugins/*.dll $PWD/${{ matrix.qt_arch }}/cui/ | |
cp $PWD/cmd/hannah/hannah.exe $PWD/${{ matrix.qt_arch }}/cui/ | |
cp $PWD/cmd/reverseProxy/rp.exe $PWD/${{ matrix.qt_arch }}/cui/ | |
- name: Build Reverse Proxy Library | |
shell: cmd | |
env: | |
vc_arch: ${{ matrix.msvc_arch }} | |
mingw_arch: ${{ matrix.mingw_arch }} | |
run: | | |
cd lib\reverseProxy | |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" %vc_arch% | |
set PATH=D:\a\_temp\msys\msys64\%mingw_arch%\bin;%PATH%;C:\hostedtoolcache\windows\go\${{ env.go_version }}\x64\bin | |
call ${{ matrix.BUILDRP }} | |
cd ..\.. | |
- name: Install Qt | |
uses: jurplel/install-qt-action@v3 | |
with: | |
version: ${{ matrix.qt_ver }} | |
target: ${{ env.qt_target }} | |
arch: ${{ matrix.qt_arch }} | |
modules: ${{ matrix.qt_modules }} | |
cache: 'true' | |
cache-key-prefix: 'install-qt-action-${{ matrix.qt_arch }}-${{ matrix.qt_ver }}' | |
aqtversion: '==3.0.1' | |
- name: Set up jom | |
shell: cmd | |
run: | | |
mkdir jom | |
cd jom | |
curl.exe -o jom.zip -L https://download.qt.io/official_releases/jom/jom_1_1_3.zip | |
if exist jom.zip 7z.exe x jom.zip | |
cd .. | |
- name: Build GUI executables | |
shell: cmd | |
env: | |
vc_arch: ${{ matrix.msvc_arch }} | |
run: | | |
mkdir -p ${{ matrix.qt_arch }}\gui | |
mkdir build | |
cd build | |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" %vc_arch% | |
qmake -r CONFIG+=release CONFIG+=qtquickcompiler .. | |
mkdir -p desktop\release\translations | |
if exist %CD%\jom\jom.exe jom.exe -j %NUMBER_OF_PROCESSORS% | |
if not exist %CD%\jom\jom.exe nmake | |
copy desktop\release\Hannah.exe ..\${{ matrix.qt_arch }}\gui\ | |
windeployqt.exe -qmldir=..\desktop\rc\qml ..\${{ matrix.qt_arch }}\gui\Hannah.exe | |
copy registerProtocolHandler\release\registerProtocolHandler.exe ..\${{ matrix.qt_arch }}\gui\ | |
copy ..\lib\reverseProxy\*.dll ..\${{ matrix.qt_arch }}\gui\ | |
cd .. | |
- shell: msys2 {0} | |
run : | | |
cp -r $PWD/build/desktop/release/translations $PWD/${{ matrix.qt_arch }}/gui/ | |
- name: package Chrome extension | |
shell: msys2 {0} | |
run: | | |
cd $PWD/browser/chrome | |
zip $PWD/../../${{ matrix.qt_arch }}/hannah-chrome-extension.crx ./* | |
cd $PWD/../.. | |
- name: package Firefox extension | |
shell: msys2 {0} | |
run: | | |
cd $PWD/browser/firefox | |
zip $PWD/../../${{ matrix.qt_arch }}/hannah-firefox-addon.xpi ./* | |
cd $PWD/../.. | |
- name: Upload artifact hannah-${{ matrix.qt_arch }}-${{ matrix.qt_ver }} | |
uses: actions/upload-artifact@v1.0.0 | |
with: | |
name: hannah-${{ matrix.qt_arch }}-${{ matrix.qt_ver }} | |
path: ${{ matrix.qt_arch }} | |
Windows-Intel-oneAPI: | |
runs-on: windows-latest | |
strategy: | |
matrix: | |
include: | |
- qt_arch: win64_msvc2019_64 | |
qt_ver: 5.15.2 | |
qt_modules: "" | |
mingw_arch: MINGW64 | |
mingw_prefix: mingw-w64-x86_64 | |
toolchains: gcc | |
GOARCH: amd64 | |
BUILDRP: build-x64.bat | |
msvc_arch: x64 | |
- qt_arch: win64_msvc2019_64 | |
qt_ver: 6.5.1 | |
qt_modules: "qt5compat qtimageformats" | |
mingw_arch: MINGW64 | |
mingw_prefix: mingw-w64-x86_64 | |
toolchains: gcc | |
GOARCH: amd64 | |
BUILDRP: build-x64.bat | |
msvc_arch: x64 | |
env: | |
go_version: 1.20.6 | |
qt_target: desktop | |
steps: | |
- uses: msys2/setup-msys2@v2 | |
with: | |
update: true | |
msystem: ${{ matrix.mingw_arch }} | |
install: zip make git ${{ matrix.mingw_prefix }}-${{ matrix.toolchains }} ${{ matrix.mingw_prefix }}-make ${{ matrix.mingw_prefix }}-zstd | |
- name: Set up Go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: ${{ env.go_version }} | |
id: go | |
- run: go version && go env | |
- name: Check out code into the Go module directory | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 1 | |
ref: ${{ github.head_ref }} | |
- name: Build Go executables | |
shell: msys2 {0} | |
run: | | |
env GOARCH=${{ matrix.GOARCH }} PATH=/${{ matrix.mingw_arch }}/bin:$PATH:/C/hostedtoolcache/windows/go/${{ env.go_version }}/x64/bin make | |
cd lib/reverseProxy | |
./update-def.sh | |
cd ../.. | |
mkdir -p ${{ matrix.qt_arch }}/cui | |
cp $PWD/output/bass/lib/windows/${{ matrix.GOARCH }}/bass.dll $PWD/${{ matrix.qt_arch }}/cui/ | |
cp $PWD/output/bass/lib/windows/${{ matrix.GOARCH }}/plugins/*.dll $PWD/${{ matrix.qt_arch }}/cui/ | |
cp $PWD/cmd/hannah/hannah.exe $PWD/${{ matrix.qt_arch }}/cui/ | |
cp $PWD/cmd/reverseProxy/rp.exe $PWD/${{ matrix.qt_arch }}/cui/ | |
- name: Build Reverse Proxy Library | |
shell: cmd | |
env: | |
vc_arch: ${{ matrix.msvc_arch }} | |
mingw_arch: ${{ matrix.mingw_arch }} | |
run: | | |
cd lib\reverseProxy | |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" %vc_arch% | |
set PATH=D:\a\_temp\msys\msys64\%mingw_arch%\bin;%PATH%;C:\hostedtoolcache\windows\go\${{ env.go_version }}\x64\bin | |
call ${{ matrix.BUILDRP }} | |
cd ..\.. | |
- name: Install Qt | |
uses: jurplel/install-qt-action@v3 | |
with: | |
version: ${{ matrix.qt_ver }} | |
target: ${{ env.qt_target }} | |
arch: ${{ matrix.qt_arch }} | |
modules: ${{ matrix.qt_modules }} | |
cache: 'true' | |
cache-key-prefix: 'install-qt-action-${{ matrix.qt_arch }}-${{ matrix.qt_ver }}' | |
aqtversion: '==3.0.1' | |
- name: Set up jom | |
shell: cmd | |
run: | | |
mkdir jom | |
cd jom | |
curl.exe -o jom.zip -L https://download.qt.io/official_releases/jom/jom_1_1_3.zip | |
if exist jom.zip 7z.exe x jom.zip | |
cd .. | |
- name: cache intel install | |
id: cache-install | |
uses: actions/cache@v2 | |
with: | |
path: | | |
C:\Program Files (x86)\Intel\oneAPI\setvars-vcvarsall.bat | |
C:\Program Files (x86)\Intel\oneAPI\compiler | |
key: install-${{ env.CACHE_NUMBER }}-${{ env.WINDOWS_HPCKIT_URL }}-${{ env.WINDOWS_CPP_COMPONENTS }}-compiler-${{ hashFiles('**/scripts/cache_exclude_windows.sh') }} | |
- name: install intel | |
if: steps.cache-install.outputs.cache-hit != 'true' | |
run: | | |
git clone --depth=1 https://github.com/oneapi-src/oneapi-ci.git oneapi-ci | |
cd oneapi-ci | |
scripts/install_windows.bat ${{ env.WINDOWS_HPCKIT_URL }} ${{ env.WINDOWS_CPP_COMPONENTS }} | |
- name: restore registry on cache hit | |
if: steps.cache-install.outputs.cache-hit == 'true' | |
run: | | |
git clone --depth=1 https://github.com/oneapi-src/oneapi-ci.git oneapi-ci | |
cd oneapi-ci | |
scripts/restore_registry.bat ${{ env.COMPILER_VERSION }} | |
- name: Build GUI executables | |
shell: cmd | |
env: | |
vc_arch: ${{ matrix.msvc_arch }} | |
run: | | |
mkdir -p ${{ matrix.qt_arch }}\gui | |
mkdir build | |
cd build | |
dir "C:\Program Files (x86)\Intel\oneAPI\compiler" | |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" %vc_arch% | |
call "C:\Program Files (x86)\Intel\oneAPI\compiler\${{ env.COMPILER_VERSION }}\env\vars.bat" | |
set PATH="C:\Program Files (x86)\Intel\oneAPI\compiler\${{ env.COMPILER_VERSION }}\windows\bin-llvm\";%CD%\jom;%PATH% | |
qmake -r CONFIG+=release -spec win32-clang-msvc CONFIG+=qtquickcompiler .. | |
mkdir -p desktop\release\translations | |
if exist %CD%\jom\jom.exe jom.exe -j %NUMBER_OF_PROCESSORS% | |
if not exist %CD%\jom\jom.exe nmake | |
copy desktop\release\Hannah.exe ..\${{ matrix.qt_arch }}\gui\ | |
windeployqt.exe -qmldir=..\desktop\rc\qml ..\${{ matrix.qt_arch }}\gui\Hannah.exe | |
copy registerProtocolHandler\release\registerProtocolHandler.exe ..\${{ matrix.qt_arch }}\gui\ | |
copy ..\lib\reverseProxy\*.dll ..\${{ matrix.qt_arch }}\gui\ | |
cd .. | |
- shell: msys2 {0} | |
run : | | |
cp -r $PWD/build/desktop/release/translations $PWD/${{ matrix.qt_arch }}/gui/ | |
- name: package Chrome extension | |
shell: msys2 {0} | |
run: | | |
cd $PWD/browser/chrome | |
zip $PWD/../../${{ matrix.qt_arch }}/hannah-chrome-extension.crx ./* | |
cd $PWD/../.. | |
- name: package Firefox extension | |
shell: msys2 {0} | |
run: | | |
cd $PWD/browser/firefox | |
zip $PWD/../../${{ matrix.qt_arch }}/hannah-firefox-addon.xpi ./* | |
cd $PWD/../.. | |
- name: Upload artifact hannah-${{ matrix.qt_arch }}-${{ matrix.qt_ver }} | |
uses: actions/upload-artifact@v1.0.0 | |
with: | |
name: hannah-${{ matrix.qt_arch }}-${{ matrix.qt_ver }} | |
path: ${{ matrix.qt_arch }} | |
Windows-MSVC-clang: | |
runs-on: windows-latest | |
strategy: | |
matrix: | |
include: | |
- qt_arch: win64_msvc2019_64 | |
qt_ver: 5.15.2 | |
qt_modules: "" | |
mingw_arch: MINGW64 | |
mingw_prefix: mingw-w64-x86_64 | |
toolchains: gcc | |
GOARCH: amd64 | |
BUILDRP: build-x64.bat | |
msvc_arch: x64 | |
clang_link: llvm-win-x64.7z | |
- qt_arch: win64_msvc2019_64 | |
qt_ver: 6.5.1 | |
qt_modules: "qt5compat qtimageformats" | |
mingw_arch: MINGW64 | |
mingw_prefix: mingw-w64-x86_64 | |
toolchains: gcc | |
GOARCH: amd64 | |
BUILDRP: build-x64.bat | |
msvc_arch: x64 | |
clang_link: llvm-win-x64.7z | |
- qt_arch: win32_msvc2019 | |
qt_ver: 5.15.2 | |
qt_modules: "" | |
mingw_arch: MINGW32 | |
mingw_prefix: mingw-w64-i686 | |
toolchains: gcc | |
GOARCH: 386 | |
BUILDRP: build-x86.bat | |
msvc_arch: x86 | |
clang_link: llvm-win-x86.7z | |
env: | |
go_version: 1.20.6 | |
qt_target: desktop | |
steps: | |
- uses: msys2/setup-msys2@v2 | |
with: | |
update: true | |
msystem: ${{ matrix.mingw_arch }} | |
install: zip make git ${{ matrix.mingw_prefix }}-${{ matrix.toolchains }} ${{ matrix.mingw_prefix }}-make ${{ matrix.mingw_prefix }}-zstd | |
- name: Set up Go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: ${{ env.go_version }} | |
id: go | |
- run: go version && go env | |
- name: Check out code into the Go module directory | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 1 | |
ref: ${{ github.head_ref }} | |
- name: Set up clang for Windows | |
shell: cmd | |
run: | | |
mkdir llvm | |
cd llvm | |
curl.exe -o LLVM.7z -L ${{ secrets.CLANG_SERVER }}/${{ matrix.clang_link }} | |
7z.exe x LLVM.7z | |
cd .. | |
- name: Build Go executables | |
shell: msys2 {0} | |
run: | | |
env GOARCH=${{ matrix.GOARCH }} PATH=/${{ matrix.mingw_arch }}/bin:$PATH:/C/hostedtoolcache/windows/go/${{ env.go_version }}/x64/bin make | |
cd lib/reverseProxy | |
./update-def.sh | |
cd ../.. | |
mkdir -p ${{ matrix.qt_arch }}/cui | |
cp $PWD/output/bass/lib/windows/${{ matrix.GOARCH }}/bass.dll $PWD/${{ matrix.qt_arch }}/cui/ | |
cp $PWD/output/bass/lib/windows/${{ matrix.GOARCH }}/plugins/*.dll $PWD/${{ matrix.qt_arch }}/cui/ | |
cp $PWD/cmd/hannah/hannah.exe $PWD/${{ matrix.qt_arch }}/cui/ | |
cp $PWD/cmd/reverseProxy/rp.exe $PWD/${{ matrix.qt_arch }}/cui/ | |
- name: Build Reverse Proxy Library | |
shell: cmd | |
env: | |
vc_arch: ${{ matrix.msvc_arch }} | |
mingw_arch: ${{ matrix.mingw_arch }} | |
run: | | |
cd lib\reverseProxy | |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" %vc_arch% | |
set PATH=D:\a\_temp\msys\msys64\%mingw_arch%\bin;%PATH%;C:\hostedtoolcache\windows\go\${{ env.go_version }}\x64\bin | |
call ${{ matrix.BUILDRP }} | |
cd ..\.. | |
- name: Install Qt | |
uses: jurplel/install-qt-action@v3 | |
with: | |
version: ${{ matrix.qt_ver }} | |
target: ${{ env.qt_target }} | |
arch: ${{ matrix.qt_arch }} | |
modules: ${{ matrix.qt_modules }} | |
cache: 'true' | |
cache-key-prefix: 'install-qt-action-${{ matrix.qt_arch }}-${{ matrix.qt_ver }}' | |
aqtversion: '==3.0.1' | |
- name: Set up jom | |
shell: cmd | |
run: | | |
mkdir jom | |
cd jom | |
curl.exe -o jom.zip -L https://download.qt.io/official_releases/jom/jom_1_1_3.zip | |
if exist jom.zip 7z.exe x jom.zip | |
cd .. | |
- name: Build GUI executables | |
shell: cmd | |
env: | |
vc_arch: ${{ matrix.msvc_arch }} | |
run: | | |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" %vc_arch% | |
set PATH=%PATH%;%CD%\llvm;%CD%\llvm\bin | |
path | |
dir | |
dir %CD%\llvm | |
dir %CD%\llvm\bin | |
mkdir -p ${{ matrix.qt_arch }}\gui | |
mkdir build | |
cd build | |
qmake -r CONFIG+=release -spec win32-clang-msvc CONFIG+=qtquickcompiler .. | |
mkdir -p desktop\release\translations | |
if exist %CD%\jom\jom.exe jom.exe -j %NUMBER_OF_PROCESSORS% | |
if not exist %CD%\jom\jom.exe nmake | |
copy desktop\release\Hannah.exe ..\${{ matrix.qt_arch }}\gui\ | |
windeployqt.exe -qmldir=..\desktop\rc\qml ..\${{ matrix.qt_arch }}\gui\Hannah.exe | |
copy registerProtocolHandler\release\registerProtocolHandler.exe ..\${{ matrix.qt_arch }}\gui\ | |
copy ..\lib\reverseProxy\*.dll ..\${{ matrix.qt_arch }}\gui\ | |
cd .. | |
- shell: msys2 {0} | |
run : | | |
cp -r $PWD/build/desktop/release/translations $PWD/${{ matrix.qt_arch }}/gui/ | |
- name: package Chrome extension | |
shell: msys2 {0} | |
run: | | |
cd $PWD/browser/chrome | |
zip $PWD/../../${{ matrix.qt_arch }}/hannah-chrome-extension.crx ./* | |
cd $PWD/../.. | |
- name: package Firefox extension | |
shell: msys2 {0} | |
run: | | |
cd $PWD/browser/firefox | |
zip $PWD/../../${{ matrix.qt_arch }}/hannah-firefox-addon.xpi ./* | |
cd $PWD/../.. | |
- name: Upload artifact hannah-${{ matrix.qt_arch }}-${{ matrix.qt_ver }} | |
uses: actions/upload-artifact@v1.0.0 | |
with: | |
name: hannah-${{ matrix.qt_arch }}-${{ matrix.qt_ver }}-clang | |
path: ${{ matrix.qt_arch }} | |
Windows-MinGW: | |
runs-on: windows-latest | |
strategy: | |
matrix: | |
include: | |
- qt_arch: mingw64_qt5-static-gcc | |
mingw_arch: MINGW64 | |
mingw_prefix: mingw-w64-x86_64 | |
toolchains: gcc | |
mkspec: win32-g++ | |
c: gcc | |
cxx: g++ | |
qt_build: qt5-static | |
qmake: /mingw64/qt5-static/bin/qmake.exe | |
GOARCH: amd64 | |
- qt_arch: mingw32_qt5-static-gcc | |
mingw_arch: MINGW32 | |
mingw_prefix: mingw-w64-i686 | |
toolchains: gcc | |
mkspec: win32-g++ | |
c: gcc | |
cxx: g++ | |
qt_build: qt5-static | |
qmake: /mingw32/qt5-static/bin/qmake.exe | |
GOARCH: 386 | |
- qt_arch: mingw64_qt5-gcc | |
mingw_arch: MINGW64 | |
mingw_prefix: mingw-w64-x86_64 | |
toolchains: gcc | |
mkspec: win32-g++ | |
c: gcc | |
cxx: g++ | |
qt_build: qt5 | |
qmake: qmake.exe | |
GOARCH: amd64 | |
- qt_arch: mingw32_qt5-gcc | |
mingw_arch: MINGW32 | |
mingw_prefix: mingw-w64-i686 | |
toolchains: gcc | |
mkspec: win32-g++ | |
c: gcc | |
cxx: g++ | |
qt_build: qt5 | |
qmake: qmake.exe | |
GOARCH: 386 | |
- qt_arch: mingw64_qt5-clang | |
mingw_arch: MINGW64 | |
mingw_prefix: mingw-w64-x86_64 | |
toolchains: clang | |
mkspec: win32-clang-g++ | |
c: clang | |
cxx: clang++ | |
qt_build: qt5 | |
qmake: qmake.exe | |
GOARCH: amd64 | |
- qt_arch: mingw32_qt5-clang | |
mingw_arch: MINGW32 | |
mingw_prefix: mingw-w64-i686 | |
toolchains: clang | |
mkspec: win32-clang-g++ | |
c: clang | |
cxx: clang++ | |
qt_build: qt5 | |
qmake: qmake.exe | |
GOARCH: 386 | |
- qt_arch: mingw64_qt6-gcc | |
mingw_arch: MINGW64 | |
mingw_prefix: mingw-w64-x86_64 | |
toolchains: gcc | |
mkspec: win32-g++ | |
c: gcc | |
cxx: g++ | |
qt_build: qt6 | |
qmake: qmake6.exe | |
GOARCH: amd64 | |
- qt_arch: mingw64_qt6-clang | |
mingw_arch: MINGW64 | |
mingw_prefix: mingw-w64-x86_64 | |
toolchains: clang | |
mkspec: win32-clang-g++ | |
c: clang | |
cxx: clang++ | |
qt_build: qt6 | |
qmake: qmake6.exe | |
GOARCH: amd64 | |
env: | |
go_version: 1.20.6 | |
steps: | |
- uses: msys2/setup-msys2@v2 | |
with: | |
update: true | |
msystem: ${{ matrix.mingw_arch }} | |
install: zip make git ${{ matrix.mingw_prefix }}-${{ matrix.toolchains }} ${{ matrix.mingw_prefix }}-make ${{ matrix.mingw_prefix }}-cmake ${{ matrix.mingw_prefix }}-${{ matrix.qt_build }} ${{ matrix.mingw_prefix }}-openssl ${{ matrix.mingw_prefix }}-zstd | |
- name: Set up Go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: ${{ env.go_version }} | |
id: go | |
- run: go version && go env | |
- name: Check out code into the Go module directory | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 1 | |
ref: ${{ github.head_ref }} | |
- run: | | |
git clone https://github.com/missdeer/mingwdeployqt.git | |
- name: Build mingwdeployqt | |
shell: msys2 {0} | |
run: | | |
cd mingwdeployqt | |
mkdir build | |
cd build | |
env PATH=$PATH:/${{ matrix.mingw_arch }}/bin cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=${{ matrix.c }} -DCMAKE_CXX_COMPILER=${{ matrix.cxx }} -G Ninja .. | |
ninja | |
cp mingwdeployqt.exe /${{ matrix.mingw_arch }}/bin/ | |
cd ../.. | |
- name: Build Go executables | |
shell: msys2 {0} | |
run: | | |
env GOARCH=${{ matrix.GOARCH }} PATH=/${{ matrix.mingw_arch }}/bin:$PATH:/C/hostedtoolcache/windows/go/${{ env.go_version }}/x64/bin make | |
mkdir -p ${{ matrix.mingw_prefix }}/cui | |
cp $PWD/output/bass/lib/windows/${{ matrix.GOARCH }}/bass.dll $PWD/${{ matrix.mingw_prefix }}/cui/ | |
cp $PWD/output/bass/lib/windows/${{ matrix.GOARCH }}/plugins/*.dll $PWD/${{ matrix.mingw_prefix }}/cui/ | |
cp $PWD/cmd/hannah/hannah.exe $PWD/${{ matrix.mingw_prefix }}/cui/ | |
cp $PWD/cmd/reverseProxy/rp.exe $PWD/${{ matrix.mingw_prefix }}/cui/ | |
- name: Build GUI executables | |
shell: msys2 {0} | |
run: | | |
mkdir -p $PWD/${{ matrix.mingw_prefix }}/gui | |
mkdir build | |
cd build | |
env PATH=$PATH:/${{ matrix.mingw_arch }}/bin cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=${{ matrix.c }} -DCMAKE_CXX_COMPILER=${{ matrix.cxx }} -DCMAKE_PREFIX_PATH=${{ matrix.mingw_arch }}/bin .. | |
env PATH=$PATH:/${{ matrix.mingw_arch }}/bin cmake --build . --parallel | |
mkdir -p $PWD/desktop/release/translations | |
cp $PWD/desktop/release/Hannah.exe $PWD/../${{ matrix.mingw_prefix }}/gui/ | |
env PATH=$PATH:/${{ matrix.mingw_arch }}/bin /${{ matrix.mingw_arch }}/bin/mingwdeployqt.exe $PWD/../${{ matrix.mingw_prefix }}/gui/Hannah.exe | |
cp -r $PWD/desktop/release/translations $PWD/../${{ matrix.mingw_prefix }}/gui/ | |
cp $PWD/registerProtocolHandler/release/registerProtocolHandler.exe $PWD/../${{ matrix.mingw_prefix }}/gui/ | |
cp $PWD/cmd/reverseProxy/rp.exe $PWD/${{ matrix.mingw_prefix }}/gui/ | |
env PATH=$PATH:/${{ matrix.mingw_arch }}/bin /${{ matrix.mingw_arch }}/bin/mingwdeployqt.exe $PWD/../${{ matrix.mingw_prefix }}/gui/registerProtocolHandler.exe | |
cd .. | |
- name: package Chrome extension | |
shell: msys2 {0} | |
run: | | |
cd $PWD/browser/chrome | |
zip $PWD/../../${{ matrix.mingw_prefix }}/hannah-chrome-extension.crx ./* | |
cd $PWD/../.. | |
- name: package Firefox extension | |
shell: msys2 {0} | |
run: | | |
cd $PWD/browser/firefox | |
zip $PWD/../../${{ matrix.mingw_prefix }}/hannah-firefox-addon.xpi ./* | |
cd $PWD/../.. | |
- name: Upload artifact hannah-${{ matrix.mingw_prefix }}-${{ matrix.qt_arch }} | |
uses: actions/upload-artifact@v1.0.0 | |
with: | |
name: hannah-${{ matrix.qt_arch }} | |
path: ${{ matrix.mingw_prefix }} | |
Darwin: | |
runs-on: macos-latest | |
strategy: | |
matrix: | |
include: | |
- qt_ver: 5.15.2 | |
qt_modules: "" | |
- qt_ver: 6.5.1 | |
qt_modules: "qt5compat qtimageformats" | |
env: | |
go_version: 1.20.6 | |
qt_target: desktop | |
qt_arch: clang_64 | |
steps: | |
- uses: maxim-lobanov/setup-xcode@v1 | |
with: | |
xcode-version: 'latest-stable' | |
- name: Set up Go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: ${{ env.go_version }} | |
id: go | |
- run: go version && go env | |
- name: Check out code into the Go module directory | |
uses: actions/checkout@v2 | |
with: | |
ref: master | |
- name: Build Go executables | |
run: | | |
brew install pkg-config | |
make | |
install_name_tool -change @executable_path/../../output/bass/lib/darwin/amd64/libbass.dylib @executable_path/libbass.dylib cmd/hannah/hannah | |
mkdir darwin-amd64 | |
mv $PWD/cmd/hannah/hannah darwin-amd64/ | |
cp $PWD/output/bass/lib/darwin/amd64/libbass.dylib darwin-amd64/ | |
cp $PWD/output/bass/lib/darwin/amd64/plugins/*.dylib darwin-amd64/ | |
mv $PWD/cmd/reverseProxy/rp darwin-amd64/ | |
- name: Install Qt | |
uses: jurplel/install-qt-action@v3 | |
with: | |
version: ${{ matrix.qt_ver }} | |
target: ${{ env.qt_target }} | |
arch: ${{ env.qt_arch }} | |
modules: ${{ matrix.qt_modules }} | |
cache: 'true' | |
cache-key-prefix: 'install-qt-action-${{ env.qt_arch }}-${{ matrix.qt_ver }}' | |
aqtversion: '==3.0.1' | |
- name: build macos | |
run: | | |
cd desktop | |
mkdir build | |
cd build | |
qmake -r CONFIG+=release CONFIG+=qtquickcompiler .. | |
make -j `sysctl -n hw.logicalcpu` | |
cd .. | |
- name: package desktop | |
run: | | |
macdeployqt "desktop/build/Hannah.app" -qmldir=desktop/rc/qml -verbose=1 -dmg | |
cp desktop/build/Hannah.dmg darwin-amd64/ | |
- name: package Chrome extension | |
run: | | |
cd browser/chrome | |
zip ../../darwin-amd64/hannah.crx ./* | |
cd ../.. | |
- name: package Firefox extension | |
run: | | |
cd browser/firefox | |
zip ../../darwin-amd64/hannah.xpi ./* | |
cd ../.. | |
- name: Upload artifact hannah-darwin-amd64 | |
uses: actions/upload-artifact@v1.0.0 | |
with: | |
name: hannah-darwin-amd64-qt${{ matrix.qt_ver }} | |
path: darwin-amd64 |