154 lines
5.9 KiB
YAML
154 lines
5.9 KiB
YAML
name: Debug Build & Package
|
|
|
|
on:
|
|
push:
|
|
branches: [ 'develop-**', 'dev/**' ]
|
|
paths-ignore:
|
|
- 'resource/locale/template/**'
|
|
- 'docs/**'
|
|
- '**.md'
|
|
pull_request:
|
|
branches: [ 'develop-**', 'dev/**' ]
|
|
paths-ignore:
|
|
- 'resource/locale/template/**'
|
|
- 'docs/**'
|
|
- '**.md'
|
|
|
|
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-10.15', '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 ninja-build
|
|
sudo apt-get -y install gpg
|
|
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-10.15'
|
|
|
|
- name: Install Dependence (macOS)
|
|
run: |
|
|
brew install cmake git autoconf automake qt@5 gcc texinfo gettext gpgme openssl@1.1
|
|
brew install boost libconfig gettext ninja
|
|
brew unlink gettext && brew link --force gettext
|
|
brew link qt@5
|
|
brew link gcc
|
|
brew link openssl@1.1 --force
|
|
if: matrix.os == 'macos-10.15'
|
|
|
|
- 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
|
|
pacman --noconfirm -S --needed make texinfo mingw-w64-x86_64-libconfig mingw-w64-x86_64-boost automake
|
|
pacman --noconfirm -S --needed mingw-w64-x86_64-qt5 libintl msys2-runtime-devel gettext-devel texinfo
|
|
pacman --noconfirm -S --needed mingw-w64-x86_64-ninja mingw-w64-x86_64-gnupg
|
|
pacman --noconfirm -S --needed mingw-w64-x86_64-libarchive
|
|
if: matrix.os == 'windows-latest'
|
|
|
|
- name: Build GpgME (Windows)
|
|
shell: msys2 {0}
|
|
run: |
|
|
cd $(echo "/${{github.workspace}}/third_party/gpgme" | sed 's/\\/\//g' | sed 's/://')
|
|
./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: Build GpgFrontend (Linux)
|
|
# Build your GpgFrontend with the given configuration
|
|
run: |
|
|
cmake -G Ninja -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DGPGFRONTEND_BUILD_TYPE_TEST_UI=ON
|
|
cmake --build ${{github.workspace}}/build --config {{$env.BUILD_TYPE}} -- -v
|
|
if: matrix.os == 'ubuntu-latest'
|
|
|
|
- name: Build GpgFrontend (macOS)
|
|
# Build your GpgFrontend with the given configuration
|
|
run: |
|
|
cmake -G Ninja -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DGPGFRONTEND_BUILD_TYPE_TEST_UI=ON -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl@1.1
|
|
cmake --build ${{github.workspace}}/build --config {{$env.BUILD_TYPE}} -- -v
|
|
if: matrix.os == 'macos-10.15'
|
|
|
|
- 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 Ninja -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DGPGFRONTEND_BUILD_TYPE_TEST_UI=ON ..
|
|
# 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-10.15'
|
|
|
|
- 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'
|