diff options
Diffstat (limited to '')
-rw-r--r-- | .github/workflows/release-linux-package.yml | 112 | ||||
-rw-r--r-- | .github/workflows/release.yml | 17 | ||||
-rw-r--r-- | CMakeLists.txt | 6 |
3 files changed, 117 insertions, 18 deletions
diff --git a/.github/workflows/release-linux-package.yml b/.github/workflows/release-linux-package.yml new file mode 100644 index 00000000..43f26e9b --- /dev/null +++ b/.github/workflows/release-linux-package.yml @@ -0,0 +1,112 @@ +name: Build Linux Packages + +on: + push: + branches: [ main, develop ] + paths-ignore: + - '**/README.md' + - '**/README_CN.md' + - 'resource/ts/**' + - 'docs/**' + pull_request: + branches: [ develop ] + paths-ignore: + - '**/README.md' + - '**/README_CN.md' + - 'resource/ts/**' + - 'docs/**' + +env: + # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) + BUILD_TYPE: Release + EXECUTABLE_OUTPUT_PATH: ./ + +jobs: + build: + strategy: + matrix: + os: [ 'ubuntu-18.04' ] + runs-on: ${{ matrix.os }} + steps: + + - uses: actions/checkout@v2 + with: + submodules: recursive + + - name: Get Short SHA of Commit + id: vars + run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)" + + - name: Install Dependence (Linux) + run: | + sudo apt-get update + sudo apt-get -y install build-essential binutils git autoconf automake gettext texinfo + sudo apt-get -y install gcc-8 g++-8 libconfig++-dev libboost-all-dev + sudo apt-get -y install gpgsm libxcb-xinerama0 libxcb-icccm4-dev libcups2-dev libdrm-dev libegl1-mesa-dev + sudo apt-get -y install libgcrypt11-dev libnss3-dev libpci-dev libpulse-dev libudev-dev libxtst-dev gyp ninja-build + sudo apt-get -y install libglu1-mesa-dev libfontconfig1-dev libx11-xcb-dev libicu-dev libxcb-image0 + sudo apt-get -y install libglu1-mesa-dev libfontconfig1-dev libx11-xcb-dev libicu-dev libxcb-* + sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 8 + sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-8 8 + sudo update-alternatives --set gcc "/usr/bin/gcc-8" + sudo update-alternatives --set g++ "/usr/bin/g++-8" + if: matrix.os == 'ubuntu-18.04' + + - name: Cache Qt + id: cache-qt + uses: actions/cache@v1 + with: + path: ../Qt + key: ${{ runner.os }}-QtCache-5.12.8 + if: matrix.os == 'ubuntu-18.04' + + - name: Install Qt + uses: jurplel/install-qt-action@v2 + with: + cached: ${{ steps.cache-qt.outputs.cache-hit }} + version: '5.12.8' + if: matrix.os == 'ubuntu-18.04' + + - name: Build gpg-error + run: | + cd ${{github.workspace}}/third_party/libgpg-error + ./autogen.sh + ./configure --enable-maintainer-mode --enable-static=yes && make -j2 + sudo make install + cd ${{github.workspace}} + if: matrix.os == 'ubuntu-18.04' + + - name: Build assuan + run: | + cd ${{github.workspace}}/third_party/libassuan + ./autogen.sh + ./configure --enable-maintainer-mode --enable-static=yes && make -j2 + sudo make install + cd ${{github.workspace}} + if: matrix.os == 'ubuntu-18.04' + + - name: Build GpgME + run: | + cd ${{github.workspace}}/third_party/gpgme + ./autogen.sh + ./configure --enable-maintainer-mode --enable-static=yes --enable-languages=cpp && make -j2 + sudo make install + cd ${{github.workspace}} + if: matrix.os == 'ubuntu-18.04' + + - name: Build & Package GpgFrontend (Linux DEB Package) + # Build your program with the given configuration + run: | + cmake -B ${{github.workspace}}/build-deb -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DEXECUTABLE_OUTPUT_PATH=${{env.EXECUTABLE_OUTPUT_PATH}} -DAPP_PACKAGE_DEB=ON -DLINUX_INSTALL_SOFTWARE=ON + cmake --build ${{github.workspace}}/build-deb --config {{$env.BUILD_TYPE}} -- -j 2 + cd ${{github.workspace}}/build-deb + make package + cd ${{github.workspace}} + if: matrix.os == 'ubuntu-18.04' + + - name: Upload Artifact(Linux DEB) + uses: actions/upload-artifact@master + with: + name: gpgfrontend-${{matrix.os}}-${{env.BUILD_TYPE}}-${{steps.vars.outputs.sha_short}}-deb + path: ${{github.workspace}}/build-deb/gpgfrontend*.deb* + if: matrix.os == 'ubuntu-18.04' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 64fd081c..7bb8120b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -150,16 +150,6 @@ jobs: run: cmake --build ${{github.workspace}}/build --config {{$env.BUILD_TYPE}} -- -j 2 if: matrix.os == 'ubuntu-18.04' || matrix.os == 'macos-10.15' - - name: Build & Package GpgFrontend (Linux DEB Package) - # Build your program with the given configuration - run: | - cmake -B ${{github.workspace}}/build-deb -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DEXECUTABLE_OUTPUT_PATH=${{env.EXECUTABLE_OUTPUT_PATH}} -DAPP_PACKAGE_DEB=ON -DLINUX_INSTALL_SOFTWARE=ON - cmake --build ${{github.workspace}}/build-deb --config {{$env.BUILD_TYPE}} -- -j 2 - cd ${{github.workspace}}/build-deb - make package - cd ${{github.workspace}} - if: matrix.os == 'ubuntu-18.04' - - name: Build & Sign App Bundle (macOS) run: | security -v unlock-keychain -p gpgfrontend @@ -209,13 +199,6 @@ jobs: path: ${{github.workspace}}/build/artifactOut/GpgFrontend*.AppImage* if: matrix.os == 'ubuntu-18.04' - - name: Upload Artifact(Linux DEB) - uses: actions/upload-artifact@master - with: - name: gpgfrontend-${{matrix.os}}-${{env.BUILD_TYPE}}-${{steps.vars.outputs.sha_short}}-deb - path: ${{github.workspace}}/build-deb/gpgfrontend*.deb* - if: matrix.os == 'ubuntu-18.04' - - name: Upload Artifact(macOS) uses: actions/upload-artifact@master with: diff --git a/CMakeLists.txt b/CMakeLists.txt index 4207e805..8a524da7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -278,7 +278,11 @@ find_package(Boost COMPONENTS date_time filesystem REQUIRED) if (QT5_ENV_SUPPORT) # Support Qt version Both 5.12.x and 5.15.x - find_package(Qt5 COMPONENTS Core Test Widgets PrintSupport Network REQUIRED) + if (LINUX_INSTALL_SOFTWARE) + find_package(Qt5 5.12 COMPONENTS Core Test Widgets PrintSupport Network REQUIRED) + else () + find_package(Qt5 COMPONENTS Core Test Widgets PrintSupport Network REQUIRED) + endif () # find_package(Qt5 5.15.2 EXACT COMPONENTS Core Test Widgets PrintSupport Network LinguistTools REQUIRED) # Qt configuration set(CMAKE_AUTOMOC ON) |