diff --git a/.github/workflows/build-all.yml b/.github/workflows/build-all.yml index c887bae920..d11af97aa4 100644 --- a/.github/workflows/build-all.yml +++ b/.github/workflows/build-all.yml @@ -9,14 +9,22 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code + id: snapcraft uses: actions/checkout@main with: fetch-depth: 0 + - name: install snap + uses: samuelmeuli/action-snapcraft@v2 + with: + name: snap + path: ${{ steps.snapcraft.outputs.snap }} + - name: Install Qt and dependencies run: | sudo apt-get -y update - sudo apt-get -qq install qtbase5-dev libqt5svg5-dev qt5-qmake qtbase5-dev-tools qttools5-dev-tools qtchooser libgl-dev libmuparser-dev libboost-dev librsvg2-bin libfreetype6-dev libicu-dev pkg-config libfuse2 + sudo apt-get -qq install qtbase5-dev libqt5svg5-dev qt5-qmake qtbase5-dev-tools qttools5-dev-tools qtchooser \ + libgl-dev libmuparser-dev libboost-dev librsvg2-bin libfreetype6-dev libicu-dev pkg-config libfuse2 sudo ln -snf /usr/lib/x86_64-linux-gnu/qtchooser/qt5.conf /usr/lib/x86_64-linux-gnu/qtchooser/default.conf sudo rm -rf /usr/local/lib/android @@ -64,6 +72,16 @@ jobs: path: LibreCAD*.AppImage retention-days: 2 + - name: Create snapcraft + run: | + ./scripts/createSnap.sh + + - name: Uploading snap + uses: actions/upload-artifact@v3.1.0 + with: + path: ${{ github.workspace }}/librecad**snap + name: LibreCAD.snap + BuildMacOS: runs-on: macos-latest steps: diff --git a/scripts/createSnap.sh b/scripts/createSnap.sh new file mode 100755 index 0000000000..93f31c7182 --- /dev/null +++ b/scripts/createSnap.sh @@ -0,0 +1,6 @@ +sudo snap install snapcraft --classic + +snap run snapcraft --destructive-mode + +sudo snap install librecad_2.2.1-beta_amd64.snap --devmode --dangerous + diff --git a/snapcraft.yaml b/snapcraft.yaml new file mode 100644 index 0000000000..acedcc4c7b --- /dev/null +++ b/snapcraft.yaml @@ -0,0 +1,57 @@ +name: librecad +version: '2.2.1-beta' +grade: beta +base: core22 +confinement: devmode +summary: "librecad: is a 2D open source CAD" +description: | + LibreCAD is a cross-platform 2D CAD program written in C++17. It can read DXF/DWG files and can write DXF/PDF/SVG files. It supports point/line/circle/ellipse/parabola/spline primitives. The user interface is highly customizable, and has dozens of translations. +environment: + LD_LIBRARY_PATH: $SNAP/usr/local/lib/:$SNAP/usr/lib/x86_64-linux-gnu/:$SNAP/usr/lib64/:$LD_LIBRARY_PATH + +apps: + librecad: + command: unix/librecad +parts: + librecad: + plugin: qmake + qmake-project-file: librecad.pro + build-snaps: + source: . + build-packages: + - qttools5-dev + - qttools5-dev-tools + - librsvg2-bin + - libfreetype6-dev + - libicu-dev + - libqt5opengl5-dev + - git + - g++ + - libcairo2-dev + - libpango-1.0-0 + - libpango1.0-dev + - libboost-dev + - libboost-log-dev + - libboost-program-options-dev + - libqt5svg5-dev + - libgtest-dev + - libcurl4-gnutls-dev + - libgtk-3-dev + - libglew-dev + - rapidjson-dev + - libbz2-dev + - libglfw3-dev + - libglm-dev + stage-packages: + - libboost-dev + - libboost-log-dev + - libboost-program-options-dev + #For 18.04 + #configflags: + # - "-DCMAKE_INSTALL_PREFIX=/usr" + # - "-DBUILD_SHARED_LIBS=On" + + #For 18.04 + #configflags: + # - "-DBUILD_SHARED_LIBS=On" +