1
0

179 lines
6.8 KiB
YAML

name: Debug Build & Package
on:
push:
branches: [ 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: Debug
EXECUTABLE_OUTPUT_PATH: ./
jobs:
build:
strategy:
matrix:
os: [ 'ubuntu-latest', 'macos-latest', 'windows-latest' ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- 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++ libconfig++-dev libboost-all-dev
sudo apt-get -y install gpgsm
if: matrix.os == 'ubuntu-latest'
- name: Git Sumbodule Update
run: |
git submodule update --init --recursive
- name: Codesign Configuration (macOS)
run: |
echo ${{secrets.MACOS_CERTIFICATE}} | base64 --decode > certificate.p12
security create-keychain -p gpgfrontend build.keychain
security default-keychain -s build.keychain
security unlock-keychain -p gpgfrontend build.keychain
security import certificate.p12 -k build.keychain -P ${{secrets.MAOS_CERTIFICATE_PWD}} -T /usr/bin/codesign
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k gpgfrontend build.keychain
security set-keychain-settings -lut 3600
if: matrix.os == 'macos-latest'
- name: Install Dependence (macOS)
run: |
brew install cmake git autoconf automake qt@5 gcc texinfo gettext libgpg-error libassuan gpgme openssl
brew install boost libconfig gettext
brew unlink gettext && brew link --force gettext
brew link qt@5
brew link gcc
brew link openssl --force
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-latest'
- name: Install Qt
uses: jurplel/install-qt-action@v2
with:
cached: ${{ steps.cache-qt.outputs.cache-hit }}
if: matrix.os == 'ubuntu-latest'
- 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 mingw-w64-x86_64-libconfig mingw-w64-x86_64-boost mingw-w64-x86_64-gnupg gettext-devel libintl msys2-runtime-devel
if: matrix.os == 'windows-latest'
- name: Build gpg-error (Linux)
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-latest'
- name: Build assuan (Linux)
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-latest'
- name: Build GpgME (Linux & macOS)
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-latest' || matrix.os == 'macos-latest'
- 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 --disable-gpg-test --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}} -DBUILD_CONFIG="test_ui"
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: 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/release/*
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'