Update build.yml

pull/3/head
cutefishd 5 years ago
parent c2c4694c47
commit ed2a14ab4f

@ -1,76 +1,59 @@
name: build debian package
name: CI
on:
push:
release:
types: [prereleased]
# unsafe {
branches:
- main
pull_request:
branches:
- main
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
# }
jobs:
check_commit_msg:
outputs:
commit_message: ${{ steps.get_message.outputs.message }}
name: Check if the workflow has been disabled.
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Get commit message
id: get_message
run: |
echo "::set-output name=message::$(git log --format=%B -n 1 ${{ github.event.after }})"
echo "::set-env name=message::$(git log --format=%B -n 1 ${{ github.event.after }})"
linux:
linux:
if: "!contains(github.event.head_commit.message, 'ci skip')"
strategy:
fail-fast: false
matrix:
distro: [stable, unstable]
needs: check_commit_msg
if: ${{ !contains( needs.check_commit_msg.outputs.commit_message, 'NO_DEB') }}
name: Debian ${{ matrix.distro }}
matrix:
compiler:
- gcc
- clang
container:
- suse-qt512
- suse-qt514
- suse-qt515
runs-on: ubuntu-latest
container: debian:${{ matrix.distro }}
steps:
- name: Install git
- name: Extract branch name
id: extract_branch
shell: bash
run: |
apt-get update
apt-get install -y git
- name: Checking out sources
uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: Install build dependencies
if [ -n "${{ github.base_ref }}" ]; then
echo "##[set-output name=branch;]${{ github.base_ref }}"
else
github_ref=${{ github.ref }}
echo "##[set-output name=branch;]${github_ref##*/}"
fi
- name: Qt version identifier
id: qt_version
shell: bash
run: |
apt-get install -y build-essential qtbase5-dev qttools5-dev cmake pkg-config qtdeclarative5-dev extra-cmake-modules libkf5windowsystem-dev qttools5-dev qttools5-dev-tools
qtverid=`echo "${{ matrix.container }}" | sed -e 's,suse-qt,,g'`
echo "##[set-output name=id;]${qtverid}"
- name: Build
run: |
dch -l${{ matrix.distro }} -m 'Build against ${{ matrix.distro }}' -D ${{ matrix.distro }}
dpkg-buildpackage -us -uc -i -b
- name: Copy binary
run: |
cp ../cutefish-uikit*.deb ./
- name: Sleep
if: github.event_name == 'release' && matrix.distro == 'unstable'
run: |
sleep 120
- name: Get package name
id: get_package
run: echo ::set-output name=NAME::$(basename cutefish-uikit*.deb)
- name: Upload artifact
uses: actions/upload-artifact@v2-preview
with:
name: ${{ steps.get_package.outputs.NAME }}
path: ${{ steps.get_package.outputs.NAME }}
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v1-release
if: github.event_name == 'release' && matrix.distro == 'stable'
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ steps.get_package.outputs.NAME }}
asset_name: ${{ steps.get_package.outputs.NAME }}
tag: ${{ github.ref }}
overwrite: true
set -x
mkdir -p build
cd build
# OpenSuSE containers don't have any documentation
if [ "${{ matrix.compiler }}" == "clang" ]; then
export CC=clang
export CXX=clang++
cmake .. -DLIRI_ENABLE_CLAZY:BOOL=ON -DCMAKE_INSTALL_PREFIX=/usr -DFLUID_WITH_DOCUMENTATION:BOOL=OFF
else
cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DFLUID_WITH_DOCUMENTATION:BOOL=OFF
fi
make -j $(getconf _NPROCESSORS_ONLN)
sudo make install

Loading…
Cancel
Save