diff options
author | Saturneric <[email protected]> | 2021-06-26 12:00:12 +0000 |
---|---|---|
committer | Saturneric <[email protected]> | 2021-06-26 12:00:12 +0000 |
commit | b179702a75b5b8d84986a15d53f375f7f63a0cf2 (patch) | |
tree | 32adc3d27ab6cef267e7400b6d1b248b38db991b | |
parent | Update Documents. (diff) | |
download | GpgFrontend-b179702a75b5b8d84986a15d53f375f7f63a0cf2.tar.gz GpgFrontend-b179702a75b5b8d84986a15d53f375f7f63a0cf2.zip |
Update CI
Diffstat (limited to '')
-rw-r--r-- | .github/workflows/release-ci.yml | 170 |
1 files changed, 170 insertions, 0 deletions
diff --git a/.github/workflows/release-ci.yml b/.github/workflows/release-ci.yml new file mode 100644 index 00000000..566abe1e --- /dev/null +++ b/.github/workflows/release-ci.yml @@ -0,0 +1,170 @@ +name: Build & Package CI Test + +on: + push: + branches: [ develop-ci ] + paths-ignore: + - '**/README.md' + - 'resource/ts/**' + - 'docs/**' + pull_request: + branches: [ develop-ci ] + paths-ignore: + - '**/README.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-16.04', 'macos-latest', 'windows-latest' ] + runs-on: ${{ matrix.os }} + steps: + + - uses: actions/checkout@v2 + + - 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 g++ + if: matrix.os == 'ubuntu-16.04' + + - name: Install Dependence (macOS) + run: | + brew install cmake git autoconf automake qt@5 gcc texinfo gettext libgpg-error libassuan gpgme + brew link qt@5 + brew link gcc + if: matrix.os == 'macos-latest' + + - name: Cache Qt + id: cache-qt + uses: actions/cache@v1 + with: + path: ../Qt + key: ${{ runner.os }}-QtCache + if: matrix.os == 'ubuntu-16.04' + + - name: Install Qt + uses: jurplel/install-qt-action@v2 + with: + cached: ${{ steps.cache-qt.outputs.cache-hit }} + if: matrix.os == 'ubuntu-16.04' + + - name: Set up MinGW (Windows) + uses: msys2/setup-msys2@v2 + with: + install: git msys2-devel base-devel binutils mingw-w64-x86_64-toolchain + release: false + if: matrix.os == 'windows-latest' + + - name: Set up Dependence (Windows) + shell: msys2 {0} + run: | + pacman --noconfirm -S --needed mingw-w64-x86_64-gcc mingw-w64-x86_64-make mingw-w64-x86_64-cmake autoconf automake mingw-w64-x86_64-qt-creator mingw-w64-x86_64-gpgme + pacman --noconfirm -S --needed make texinfo + if: matrix.os == 'windows-latest' + + - name: Build gpg-error (Linux) + run: | + cd ${{github.workspace}}/.. + git clone https://github.com/saturneric/libgpg-error + cd libgpg-error + ./autogen.sh + ./configure --enable-maintainer-mode --enable-static=yes && make -j2 + sudo make install + cd ${{github.workspace}} + if: matrix.os == 'ubuntu-16.04' + + - name: Build assuan (Linux) + run: | + cd ${{github.workspace}}/.. + git clone https://github.com/saturneric/libassuan + cd libassuan + ./autogen.sh + ./configure --enable-maintainer-mode --enable-static=yes && make -j2 + sudo make install + cd ${{github.workspace}} + if: matrix.os == 'ubuntu-16.04' + + - name: Build GpgME (Linux) + run: | + cd ${{github.workspace}}/.. + git clone https://github.com/saturneric/gpgme + cd gpgme + ./autogen.sh + ./configure --enable-maintainer-mode --enable-static=yes --enable-languages=cpp && make -j2 + sudo make install + cd ${{github.workspace}} + if: matrix.os == 'uubuntu-16.04' + + - name: Build GpgME (Windows) + shell: msys2 {0} + run: | + git clone https://github.com/saturneric/gpgme + cd gpgme + ./autogen.sh + ./configure --enable-maintainer-mode --enable-static=yes --enable-languages=cpp LDFLAGS="-static" && make -j2 + make install + if: matrix.os == 'windows-latest' + + - name: Configure CMake + # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. + # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type + run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DEXECUTABLE_OUTPUT_PATH=${{env.EXECUTABLE_OUTPUT_PATH}} + if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest' + + - name: Build GpgFrontend + # Build your program with the given configuration + run: cmake --build ${{github.workspace}}/build --config $env.BUILD_TYPE}} -- -j 2 + if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest' + + - name: Package App Bundle (macOS) + run: | + macdeployqt ${{github.workspace}}/build/release/GpgFrontend.app + mkdir ${{github.workspace}}/build/tmp/ + hdiutil create ${{github.workspace}}/build/tmp/tmp.dmg -ov -volname "GpgFrontend" -fs HFS+ -srcfolder ${{github.workspace}}/build/release/ + mkdir ${{github.workspace}}/build/artifactOut + hdiutil convert ${{github.workspace}}/build/tmp/tmp.dmg -format UDZO -o ${{github.workspace}}/build/artifactOut/GpgFrontend.dmg + if: matrix.os == 'macos-latest' + + - name: Configure CMake & Build Binary(Windows) + shell: msys2 {0} + run: | + cd $(echo "/${{github.workspace}}" | sed 's/\\/\//g' | sed 's/://') + mkdir build && cd build + cmake -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DEXECUTABLE_OUTPUT_PATH=${{env.EXECUTABLE_OUTPUT_PATH}} .. + # Build your program with the given configuration + cmake --build . --config ${{env.BUILD_TYPE}} -- -j 2 + if: matrix.os == 'windows-latest' + + - name: Get Short SHA of Commit + id: vars + run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)" + + - name: Upload Artifact(Linux) + uses: actions/upload-artifact@master + with: + name: gpgfrontend-${{matrix.os}}-${{env.BUILD_TYPE}}-${{steps.vars.outputs.sha_short}} + path: ${{github.workspace}}/build/release/* + if: matrix.os == 'ubuntu-latest' + + - name: Upload Artifact(macOS) + uses: actions/upload-artifact@master + with: + name: gpgfrontend-${{matrix.os}}-${{env.BUILD_TYPE}}-${{steps.vars.outputs.sha_short}} + path: ${{github.workspace}}/build/artifactOut/* + if: matrix.os == 'macos-latest' + + - name: Upload Artifact(Windows) + uses: actions/upload-artifact@master + with: + name: gpgfrontend-${{matrix.os}}-${{env.BUILD_TYPE}}-${{steps.vars.outputs.sha_short}} + path: ${{github.workspace}}/build/release/* + if: matrix.os == 'windows-latest' |