-
-
Notifications
You must be signed in to change notification settings - Fork 199
145 lines (128 loc) · 4.61 KB
/
Copy pathrelease.yml
File metadata and controls
145 lines (128 loc) · 4.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
name: Publish Release
on:
push:
branches:
- master
tags:
- release/*
pull_request:
branches:
master
permissions:
contents: write
jobs:
build:
name: Build
runs-on: ubuntu-latest
container:
image: ${{ matrix.container }}
env:
DEBIAN_FRONTEND: noninteractive
strategy:
matrix:
target:
- arm-linux-gnueabihf
- aarch64-linux-gnu
- x86_64-linux-gnu
- riscv64-linux-gnu
buildtype:
- debug
- release
include:
- target: 'x86_64-linux-gnu'
is-cross: false
debian-arch: 'amd64'
container: 'debian:bullseye'
- target: 'aarch64-linux-gnu'
is-cross: true
debian-arch: 'arm64'
container: 'debian:bullseye'
- target: 'arm-linux-gnueabihf'
is-cross: true
debian-arch: 'armhf'
container: 'debian:bullseye'
- target: 'riscv64-linux-gnu'
is-cross: true
debian-arch: 'riscv64'
container: 'debian:trixie'
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 xz-utils \
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@v4
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=$PWD/dist \
-GNinja
- name: Build & Install
run: cmake --build ./build --target install --config ${{ matrix.buildtype }}
- name: Package
run: |
mkdir -p artifact && cd artifact
cp -r ../dist/bin/flutter-pi .
tar -cJf ../flutterpi-${{ matrix.target }}-${{ matrix.buildtype }}.tar.xz .
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: flutterpi-${{ matrix.target }}-${{ matrix.buildtype }}-tar-xz
path: flutterpi-${{ matrix.target }}-${{ matrix.buildtype }}.tar.xz
if-no-files-found: error
publish:
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/release/')
name: Publish
runs-on: ubuntu-latest
needs: build
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Prepare release
run: |
mkdir -p release-files
mv artifacts/*-tar-xz/* release-files/
- name: Publish Release
uses: softprops/action-gh-release@v1
with:
fail_on_unmatched_files: true
files: release-files/*
name: ${{ github.ref_name }}
body: ${{ github.event.head_commit.message }}