[fix] Fixed Github Actions

Former-commit-id: 2fcd32e31e
This commit is contained in:
Leroy.H.Y 2019-10-26 20:16:00 +08:00
parent 7f38fb0b21
commit bc57e4be0e
6 changed files with 115 additions and 92 deletions

View File

@ -1,4 +1,4 @@
name: Build Cross-platform Qv2ray
name: Qv2ray Push Build
on: push
@ -7,26 +7,31 @@ jobs:
name: Push build for win64
runs-on: windows-2019
steps:
- name: Checkout Sources
- name: Checking out Qv2ray sources
uses: actions/checkout@master
- name: Restore Git Submodules
- name: Restoring submodules
run: git submodule update --init
# --------------------------------------------------------
- name: Install Qt
- name: Installing Qt
uses: jurplel/install-qt-action@v1
with:
arch: win64_mingw73
# --------------------------------------------------------
- name: Extract gRPC and protobuf
- name: Extracting gRPC and protobuf libs and headers
run: tools\grpc_gen.bat
# --------------------------------------------------------
- name: Build Qv2ray
- name: Building Qv2ray
shell: cmd
run: |
mkdir build
cd build
qmake ..
mingw32-make -j4
- name: Make release package
mingw32-make -j2
- name: Copying DLLs to build output folders
shell: cmd
run: .github\workflows\copy_DLLs.bat
- name: Make release zipball
shell: cmd
run: |
cd build
cd release
@ -34,7 +39,7 @@ jobs:
windeployqt ./Qv2ray.exe --compiler-runtime
cd ..
..\tools\7z.exe a Qv2ray.zip .\release
- name: Upload Artifact
- name: Uploading artifact
uses: actions/upload-artifact@master
with:
name: Qv2ray.Win64.zip
@ -46,31 +51,31 @@ jobs:
name: Push build for macOS
runs-on: macOS-10.14
steps:
- name: Checkout Sources
- name: Checking out sources
uses: actions/checkout@master
- name: Restore Git Submodules
- name: Restoring submodules
run: git submodule update --init
# --------------------------------------------------------
- name: Install Qt
- name: Installing Qt
uses: jurplel/install-qt-action@v1
# --------------------------------------------------------
- name: Extract gRPC and protobuf
- name: Extracting gRPC and protobuf libs and headers
run: tools/deps_macOS.sh
# --------------------------------------------------------
- name: Build Qv2ray
- name: Building Qv2ray
run: |
mkdir build
cd build
qmake ..
make -j4
- name: Make Package
make -j2
- name: Making release tarball
run: |
cd build
cd Qv2ray.app
macdeployqt ./
cd ..
tar czf Qv2ray.app.tar.gz Qv2ray.app
- name: Upload Artifact
- name: Uploading Artifact
uses: actions/upload-artifact@master
with:
name: Qv2ray.macOS.app.zip
@ -81,46 +86,49 @@ jobs:
name: Push build for Linux
runs-on: ubuntu-16.04
steps:
- name: Checkout Sources
- name: Checking out sources
uses: actions/checkout@master
- name: Restore Git Submodules
- name: Restoring submodules
run: git submodule update --init
# --------------------------------------------------------
- name: Install Qt
- name: Installing Qt
uses: jurplel/install-qt-action@v1
# --------------------------------------------------------
- name: Install Packages
run: sudo apt install -y libgl-dev and openssl libx11-dev libxkbcommon-x11-dev libgrpc++-dev libprotobuf-dev protobuf-compiler protobuf-c-compiler protobuf-compiler-grpc
run: |
sudo add-apt-repository ppa:webispy/grpc
sudo add-apt-repository ppa:carsten-uppenbrink-net/openssl
sudo apt update
sudo apt install -y libgl-dev openssl libx11-dev libxkbcommon-x11-dev libgrpc++-dev libprotobuf-dev protobuf-compiler protobuf-c-compiler protobuf-compiler-grpc
# --------------------------------------------------------
- name: Extract gRPC and protobuf
- name: Extracting gRPC and protobuf libs and headers
run: tools/grpc_gen.sh
# --------------------------------------------------------
- name: Update Locate DB
run: sudo updatedb
- name: Build Qv2ray
- name: Building Qv2ray
run: |
mkdir build
cd build
qmake ..
make -j4
- name: Generate FS Structure for AppImage
make -j2
- name: Generating filesystem structure for AppImage
run: |
cd build
make install INSTALL_ROOT=AppDir
cd AppDir
mkdir -p ./usr/lib/
cp /lib/x86_64-linux-gnu/libssl.so.1.1 /lib/x86_64-linux-gnu/libcrypto.so.1.1 ./usr/lib/
cp /lib/x86_64-linux-gnu/libssl.so.1.0.0 /lib/x86_64-linux-gnu/libcrypto.so.1.0.0 ./usr/lib/
- name: Build AppImage using linuxdeployqt
mkdir -p ./usr/bin/
mv ./usr/local/bin/Qv2ray ./usr/bin/Qv2ray
cp /usr/lib/x86_64-linux-gnu/libssl.so.1.1 /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1 ./usr/lib/
- name: Building AppImage using linuxdeployqt
run: |
cd build/AppDir
cd build
wget https://github.com/probonopd/linuxdeployqt/releases/download/6/linuxdeployqt-6-x86_64.AppImage
mv ./linuxdeployqt-6-x86_64.AppImage ../
chmod +x ../linuxdeployqt-6-x86_64.AppImage
../linuxdeployqt-6-x86_64.AppImage --appimage-extract
./squashfs-root/AppRun usr/share/applications/Qv2ray.desktop -appimage -no-strip -always-overwrite
chmod +x ./linuxdeployqt-6-x86_64.AppImage
./linuxdeployqt-6-x86_64.AppImage --appimage-extract
cd AppDir
../squashfs-root/AppRun usr/share/applications/Qv2ray.desktop -appimage -no-strip -always-overwrite
mv ./Qv2ray*.AppImage ./Qv2ray.AppImage
- name: Upload Artifact
- name: Uploading artifact
uses: actions/upload-artifact@master
with:
name: Qv2ray.linux.AppImage

View File

@ -1,4 +1,4 @@
name: Build Artifact for Release
name: Build Pre-Release Qv2ray
on:
release:
@ -9,34 +9,39 @@ jobs:
name: Release for Windows x64
runs-on: windows-2019
steps:
- name: Checkout Sources
- name: Checking out Qv2ray sources
uses: actions/checkout@master
- name: Restore Git Submodules
- name: Restoring submodules
run: git submodule update --init
# --------------------------------------------------------
- name: Install Qt
- name: Installing Qt
uses: jurplel/install-qt-action@v1
with:
arch: win64_mingw73
# --------------------------------------------------------
- name: Build Qv2ray
- name: Extracting gRPC and protobuf libs and headers
run: tools\grpc_gen.bat
# --------------------------------------------------------
- name: Building Qv2ray
shell: cmd
run: |
mkdir build
cd build
qmake ..
mingw32-make -j4
- name: Make release package
mingw32-make -j2
- name: Copying DLLs to build output folders
shell: cmd
run: .github\workflows\copy_DLLs.bat
- name: Make release zipball
shell: cmd
run: |
cd build
mkdir package
cd package
copy ..\release\Qv2ray.exe .\
copy ..\..\libs\libcrypto-1_1.dll .\
copy ..\..\libs\libssl-1_1.dll .\
cd release
del *.cpp *.h *.o *.qrc *.qm
windeployqt ./Qv2ray.exe --compiler-runtime
cd ..
..\tools\7z.exe a Qv2ray.zip .\package
- name: Upload Artifact
..\tools\7z.exe a Qv2ray.zip .\release
- name: Uploading artifact
uses: actions/upload-artifact@master
with:
name: Qv2ray.Win64.zip
@ -56,28 +61,31 @@ jobs:
name: Release for macOS
runs-on: macOS-10.14
steps:
- name: Checkout Sources
- name: Checking out sources
uses: actions/checkout@master
- name: Restore Git Submodules
- name: Restoring submodules
run: git submodule update --init
# --------------------------------------------------------
- name: Install Qt
- name: Installing Qt
uses: jurplel/install-qt-action@v1
# --------------------------------------------------------
- name: Build Qv2ray
- name: Extracting gRPC and protobuf libs and headers
run: tools/deps_macOS.sh
# --------------------------------------------------------
- name: Building Qv2ray
run: |
mkdir build
cd build
qmake ..
make -j4
- name: Make Package
make -j2
- name: Making release tarball
run: |
cd build
cd Qv2ray.app
macdeployqt ./
cd ..
tar czf Qv2ray.app.tar.gz Qv2ray.app
- name: Upload Artifact
- name: Uploading Artifact
uses: actions/upload-artifact@master
with:
name: Qv2ray.macOS.app.zip
@ -96,40 +104,49 @@ jobs:
name: Release for linux
runs-on: ubuntu-16.04
steps:
- name: Checkout Sources
- name: Checking out sources
uses: actions/checkout@master
- name: Restore Git Submodules
- name: Restoring submodules
run: git submodule update --init
# --------------------------------------------------------
- name: Install Qt
- name: Installing Qt
uses: jurplel/install-qt-action@v1
# --------------------------------------------------------
- name: Install libgl-dev and openssl libx11-dev libxkbcommon-x11-dev
run: sudo apt install -y libgl-dev openssl libx11-dev libxkbcommon-x11-dev
- name: Build Qv2ray
- name: Install Packages
run: |
sudo add-apt-repository ppa:webispy/grpc
sudo add-apt-repository ppa:carsten-uppenbrink-net/openssl
sudo apt update
sudo apt install -y libgl-dev openssl libx11-dev libxkbcommon-x11-dev libgrpc++-dev libprotobuf-dev protobuf-compiler protobuf-c-compiler protobuf-compiler-grpc
# --------------------------------------------------------
- name: Extracting gRPC and protobuf libs and headers
run: tools/grpc_gen.sh
# --------------------------------------------------------
- name: Building Qv2ray
run: |
mkdir build
cd build
qmake ..
make -j4
- name: Generate FS Structure for AppImage
make -j2
- name: Generating filesystem structure for AppImage
run: |
cd build
make install INSTALL_ROOT=AppDir
cd AppDir
mkdir -p ./opt/Qv2ray/lib/
cp /lib/x86_64-linux-gnu/libssl.so.1.0.0 /lib/x86_64-linux-gnu/libcrypto.so.1.0.0 ./opt/Qv2ray/lib/
cp /lib/x86_64-linux-gnu/libssl.so.1.1 /lib/x86_64-linux-gnu/libcrypto.so.1.1 ./opt/Qv2ray/lib/
- name: Build AppImage using linuxdeployqt
mkdir -p ./usr/lib/
mkdir -p ./usr/bin/
mv ./usr/local/bin/Qv2ray ./usr/bin/Qv2ray
cp /usr/lib/x86_64-linux-gnu/libssl.so.1.1 /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1 ./usr/lib/
- name: Building AppImage using linuxdeployqt
run: |
cd build/AppDir
cd build
wget https://github.com/probonopd/linuxdeployqt/releases/download/6/linuxdeployqt-6-x86_64.AppImage
mv ./linuxdeployqt-6-x86_64.AppImage ../
chmod +x ../linuxdeployqt-6-x86_64.AppImage
../linuxdeployqt-6-x86_64.AppImage --appimage-extract
./squashfs-root/AppRun opt/Qv2ray/share/applications/Qv2ray.desktop -appimage -no-strip -always-overwrite
chmod +x ./linuxdeployqt-6-x86_64.AppImage
./linuxdeployqt-6-x86_64.AppImage --appimage-extract
cd AppDir
../squashfs-root/AppRun usr/share/applications/Qv2ray.desktop -appimage -no-strip -always-overwrite
mv ./Qv2ray*.AppImage ./Qv2ray.AppImage
- name: Upload Artifact
- name: Uploading artifact
uses: actions/upload-artifact@master
with:
name: Qv2ray.linux.AppImage

5
.github/workflows/copy_DLLs.bat vendored Normal file
View File

@ -0,0 +1,5 @@
@echo off
echo Copying Windows Necessary DLLs
forfiles /s /p %GITHUB_WORKSPACE%\libs\ /m "*.dll" /c "cmd.exe /c copy @file %GITHUB_WORKSPACE%\build\release\"
forfiles /s /p %GITHUB_WORKSPACE%\libs\ /m "*.dll" /c "cmd.exe /c copy @file %GITHUB_WORKSPACE%\build\debug\"
exit 0

View File

@ -1 +1 @@
57
61

View File

@ -45,7 +45,6 @@ SOURCES += \
libs/gen/v2ray_api_commands.grpc.pb.cc
INCLUDEPATH += \
/usr/local/include/ \
3rdparty/ \
src/ \
src/ui/ \
@ -118,7 +117,7 @@ ICON = ./icons/Qv2ray.icns
message("-----------------------------------------------")
message(" ")
warning("IF YOU THINK IT'S A MISTAKE, PLEASE OPEN AN ISSUE")
error("! NOW THE BUILD WILL ABORT !")
error("! ABORTING THE BUILD !")
message(" ")
}
@ -136,6 +135,7 @@ for(var, $$list($$files("translations/*.ts", true))) {
message("Qv2ray will build with" $${replace(EXTRA_TRANSLATIONS, "translations/", "")})
TRANSLATIONS += translations/en-US.ts
message(" ")
QMAKE_CXXFLAGS += "-Wno-missing-field-initializers" "-Wno-unused-parameter" "-Wno-unused-variable"
win32 {
message("Configuring for win32 environment")
@ -155,27 +155,20 @@ win32 {
INCLUDEPATH += $$PWD/libs/gRPC-win32/include
DEPENDPATH += $$PWD/libs/gRPC-win32/include
# Some files issue.
CONFIG(release, debug|release) {
message(" --> Appending scripts for copying gRPC and protobuf dll to RELEASE directory.")
QMAKE_PRE_LINK += forfiles /s /p $${replace(PWD, /, \\)}\libs\ /m "*.dll" /c \"cmd.exe /c copy @file $${replace(OUT_PWD, /, \\)}\\release\\\"
}
CONFIG(debug, debug|release) {
message(" --> Appending scripts for copying gRPC and protobuf dll to DEBUG directory.")
QMAKE_PRE_LINK += forfiles /s /p $${replace(PWD, /, \\)}\libs\ /m "*.dll" /c \"cmd.exe /c copy @file $${replace(OUT_PWD, /, \\)}\\debug\\\"
}
PRE_TARGETDEPS += $$PWD/libs/gRPC-win32/lib/libgrpc++.dll.a $$PWD/libs/gRPC-win32/lib/libprotobuf.dll.a
}
unix {
# For Linux and macOS
message("Configuring for unix (macOS and linux) environment")
message("Configuring for unix-like (macOS and linux) environment")
# For gRPC and protobuf in linux and macOS
message(" --> Linking against gRPC and protobuf library.")
LIBS += -L/usr/local/lib -lgrpc++ -lprotobuf
# macOS homebrew include path
message(" --> Adding local include folder to search path")
INCLUDEPATH += /usr/local/include/
message(" --> Adding Plasma Toolbox CPP files.")
SOURCES += src/ui/NetSpeedBar/QvNetSpeedBar_linux.cpp
@ -187,7 +180,7 @@ unix {
icon.files += ./icons/Qv2ray.png
icon.path = /usr/share/icons/hicolor/256x256/apps/
target.path = /usr/local/bin
target.path = /usr/local/bin/
INSTALLS += target desktop icon
}

View File

@ -3,6 +3,6 @@ Type=Application
Keywords=Internet;VPN;Proxy;v2ray;Qt;
Categories=Network;Qt;
Icon=Qv2ray
Exec=/usr/local/bin/Qv2ray
Exec=Qv2ray
Name=Qv2ray
Comment=Cross platform v2ray Qt GUI Client.