diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml new file mode 100644 index 0000000..d4f34c7 --- /dev/null +++ b/.github/workflows/package.yml @@ -0,0 +1,102 @@ +name: Package + +on: [push, pull_request] + +jobs: + build_linux: + name: Linux Build + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Install Qt + uses: jurplel/install-qt-action@v2 + + - name: Install libsodium + run: sudo apt install libsodium-dev + + - name: Build + working-directory: ./LANDrop + run: qmake && make -j$(nproc) + + package_windows: + name: Windows Package + runs-on: windows-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Install Qt + uses: jurplel/install-qt-action@v2 + + - name: Install libsodium + shell: bash + run: | + curl -LO https://download.libsodium.org/libsodium/releases/libsodium-1.0.18-stable-msvc.zip + unzip libsodium-1.0.18-stable-msvc.zip + + - name: Configure + shell: bash + working-directory: ./LANDrop + run: | + echo "INCLUDEPATH += ../libsodium/include" >> LANDrop.pro + echo "LIBS += -L../libsodium/x64/Release/v142/dynamic -llibsodium" >> LANDrop.pro + + - name: Build + shell: cmd + working-directory: ./LANDrop + run: | + call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat" + qmake -tp vc + msbuild -m -p:Configuration=Release . + + - name: Package + shell: bash + working-directory: ./LANDrop + run: | + mkdir LANDrop + cd LANDrop + mv ../release/LANDrop.exe . + windeployqt LANDrop.exe + cp ../../libsodium/x64/Release/v142/dynamic/libsodium.dll . + curl -LO https://aka.ms/vs/16/release/vc_redist.x64.exe + + - name: Zip + working-directory: ./LANDrop + run: Compress-Archive LANDrop LANDrop-win.zip + + - name: Upload + uses: actions/upload-artifact@v2 + with: + name: Windows-Build + path: LANDrop/LANDrop-win.zip + + package_macos: + name: macOS Package + runs-on: macos-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Install Qt + uses: jurplel/install-qt-action@v2 + + - name: Install libsodium + run: brew install libsodium + + - name: Build + working-directory: ./LANDrop + run: qmake && make -j$(nproc) + + - name: Package + working-directory: ./LANDrop + run: | + macdeployqt LANDrop.app + zip -r9 LANDrop-macos.zip LANDrop.app + + - name: Upload + uses: actions/upload-artifact@v2 + with: + name: macOS-Build + path: LANDrop/LANDrop-macos.zip diff --git a/LANDrop/LANDrop.pro b/LANDrop/LANDrop.pro index 741a2ee..b1ba88a 100644 --- a/LANDrop/LANDrop.pro +++ b/LANDrop/LANDrop.pro @@ -43,7 +43,9 @@ TRANSLATIONS += \ RC_ICONS = icons/app.ico ICON = icons/app.icns -INCLUDEPATH += /usr/local/include -LIBS += -L/usr/local/lib -lsodium +unix { + INCLUDEPATH += /usr/local/include + LIBS += -L/usr/local/lib -lsodium +} QMAKE_INFO_PLIST = Info.plist diff --git a/LANDrop/crypto.cpp b/LANDrop/crypto.cpp index 79295d7..80b09dc 100644 --- a/LANDrop/crypto.cpp +++ b/LANDrop/crypto.cpp @@ -30,6 +30,8 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include + #include #include "crypto.h" diff --git a/LANDrop/filetransferserver.cpp b/LANDrop/filetransferserver.cpp index ea7a850..779818e 100644 --- a/LANDrop/filetransferserver.cpp +++ b/LANDrop/filetransferserver.cpp @@ -30,6 +30,8 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include + #include "filetransferdialog.h" #include "filetransferserver.h" diff --git a/LANDrop/main.cpp b/LANDrop/main.cpp index 077c878..c88dbe1 100644 --- a/LANDrop/main.cpp +++ b/LANDrop/main.cpp @@ -30,6 +30,8 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include + #include #include #include diff --git a/README.md b/README.md index e05e296..dc55549 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,5 @@ # LANDrop + +![Package](https://github.com/LANDrop/LANDrop/workflows/Package/badge.svg) + Drop any files to any devices on your LAN.