Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
121 changes: 121 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
name: Publish Release

on:
push:
branches:
- master
tags:
- release/*
pull_request:
branches:
master

jobs:
build:
name: Build
runs-on: ubuntu-latest
container:
image: debian:bullseye
env:
DEBIAN_FRONTEND: noninteractive
strategy:
matrix:
target:
- arm-linux-gnueabihf
- aarch64-linux-gnu
- x86_64-linux-gnu
buildtype:
- debug
- release
include:
- target: 'x86_64-linux-gnu'
is-cross: false
debian-arch: 'amd64'

- target: 'aarch64-linux-gnu'
is-cross: true
debian-arch: 'arm64'

- target: 'arm-linux-gnueabihf'
is-cross: true
debian-arch: 'armhf'

steps:
- name: Add debian multiarch
if: matrix.is-cross
run: dpkg --add-architecture ${{ matrix.debian-arch }}

# git needs to be installed before checking out, otherwise the checkout will fallback to the REST API,
# and the submodule download won't work.
- name: Install dependencies
env:
ARCH: ${{ matrix.debian-arch }}
run: |
apt-get update && apt-get install -y \
git cmake ninja-build clang lld \
libdrm-dev:$ARCH libgbm-dev:$ARCH libsystemd-dev:$ARCH libinput-dev:$ARCH libudev-dev:$ARCH libxkbcommon-dev:$ARCH \
libgstreamer-plugins-base1.0-dev:$ARCH \
libvulkan-dev:$ARCH \
libgl1-mesa-dev:$ARCH libgles2-mesa-dev:$ARCH libegl1-mesa-dev:$ARCH \
${{ matrix.is-cross && format('gcc-{0} g++-{0}', matrix.target) || '' }}

- uses: actions/checkout@v3
with:
submodules: 'recursive'

- name: Configure CMake
env:
CMAKE_SYSTEM_NAME: ${{ matrix.is-cross && '-DCMAKE_SYSTEM_NAME=Linux' || '' }}
CMAKE_C_COMPILER_TARGET: ${{ matrix.is-cross && format('-DCMAKE_C_COMPILER_TARGET={0}', matrix.target) || '' }}
CMAKE_CXX_COMPILER_TARGET: ${{ matrix.is-cross && format('-DCMAKE_CXX_COMPILER_TARGET={0}', matrix.target) || '' }}
PKG_CONFIG_PATH: ${{ format('/usr/lib/{0}/pkgconfig:/usr/share/pkgconfig', matrix.target) }}
PKG_CONFIG_LIBDIR: ${{ format('/usr/lib/{0}', matrix.target) }}
PKG_CONFIG_SYSROOT_DIR: ''
run: |
cmake \
-B ./build \
-S . \
-DCMAKE_BUILD_TYPE=${{ matrix.buildtype }} \
$CMAKE_SYSTEM_NAME \
$CMAKE_C_COMPILER_TARGET \
$CMAKE_CXX_COMPILER_TARGET \
-DCMAKE_C_COMPILER=clang \
-DCMAKE_EXE_LINKER_FLAGS="-fuse-ld=lld" \
-DCMAKE_CXX_COMPILER=clang++ \
-DBUILD_GSTREAMER_AUDIO_PLAYER_PLUGIN=On \
-DBUILD_GSTREAMER_VIDEO_PLAYER_PLUGIN=On \
-DENABLE_VULKAN=ON \
-DENABLE_OPENGL=ON \
-DENABLE_TESTS=On \
-DBUILD_SENTRY_PLUGIN=OFF \
-DCMAKE_INSTALL_PREFIX=$HOME/flutterpi-dist \
-GNinja

- name: Build & Install
run: cmake --build ./build --target install --config ${{ matrix.buildtype }}

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: flutterpi-${{ matrix.target }}-${{ matrix.buildtype }}
path: $HOME/flutterpi-dist/flutter-pi

publish:
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/release/')
name: Publish
runs-on: ubuntu-latest
needs: build
steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
path: binaries

- name: Publish Release
uses: softprops/action-gh-release@v1
with:
files: binaries/*
tag_name: ${{ github.ref }}
name: ${{ github.ref_name }}
body: ${{ github.event.head_commit.message }}
token: ${{ secrets.GITHUB_TOKEN }}