Skip to content

Commit

Permalink
Add build.yml, AppImageBuilder-x86_64.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
TaYaKi71751 committed Mar 21, 2024
1 parent 04df61c commit 422d895
Show file tree
Hide file tree
Showing 2 changed files with 161 additions and 0 deletions.
86 changes: 86 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: Build linux
on:
push:
workflow_dispatch:
merge_group:

jobs:
# https://github.com/AppImageCrafters/appimage-builder-flutter-example/blob/main/.github/workflows/appimage.yml
linux-build:
runs-on: ubuntu-20.04
strategy:
matrix:
include:
# - arch: armv7
# distro: ubuntu20.04
# - arch: aarch64
# distro: ubuntu20.04
- arch: x86_64
distro: ubuntu20.04
steps:
- uses: actions/checkout@v2
- uses: subosito/flutter-action@v1
if: ${{ matrix.arch == 'x86_64' }}
# with:
# flutter-version: '1.22.4'
# - run: flutter channel beta
# - run: flutter upgrade
- name: flutter config --enable-linux-desktop on host
run: flutter config --enable-linux-desktop
if: ${{ matrix.arch == 'x86_64' }}
- name: "Install dependencies"
if: ${{ matrix.arch == 'x86_64' }}
run: |
sudo apt-get update
sudo apt-get install -y cmake ninja-build build-essential pkg-config curl file git unzip xz-utils zip libgtk-3-dev
- run: echo ${{ github.event.repository.name }}
- name: Build for linux/${{ matrix.arch }} using uraimo/run-on-arch-action
if: ${{ matrix.arch != 'x86_64' }}
uses: uraimo/run-on-arch-action@v2
with:
arch: ${{ matrix.arch }}
distro: ${{ matrix.distro }}
# https://github.com/uraimo/run-on-arch-action/issues/34
setup: |
mkdir -p "${PWD}/build"
dockerRunArgs: |
--volume "${PWD}/build:/home/${USER}/${{ github.event.repository.name }}/${{ github.event.repository.name }}/build"
run: |
apt-get update > /dev/null
apt-get install -y clang cmake ninja-build build-essential pkg-config curl wget file git unzip xz-utils zip libgtk-3-dev > /dev/null
bash << EOF
if [ "${{ matrix.arch }}" == "aarch64" ];then
git clone https://github.com/flutter/flutter.git
export PATH=$PATH:$(pwd)/flutter/bin
flutter doctor -v
flutter config --enable-linux-desktop
python preprocess-linux.py
flutter build linux
find ./build/linux/*/release/plugins -type f -name '*.so' -exec cp {} ./build/linux/*/release/bundle/lib/ \;
fi
EOF
- name: Build for linux/${{ matrix.arch }} on host
if: ${{ matrix.arch == 'x86_64' }}
run: |
git clone https://github.com/flutter/flutter.git
export PATH=$PATH:$(pwd)/flutter/bin
flutter doctor -v
echo flutter build linux
flutter build linux
find ./build -type f -name '*.so'
find ./build/linux/*/release/plugins -type f -name '*.so' -exec cp {} ./build/linux/*/release/bundle/lib/ \; || true
find ./build -type f -name '*.so'
- run: find ./build -type f -name '*.so'
- name: Build AppImage unsing appimage-builder
uses: docker://appimagecrafters/appimage-builder:0.8.5
with:
entrypoint: appimage-builder
args: --recipe ./AppImageBuilder-${{ matrix.arch }}.yml --skip-test
- name: Save build Artifact
uses: actions/upload-artifact@v2
with:
name: AppImage
path: './*.AppImage*'
75 changes: 75 additions & 0 deletions AppImageBuilder-x86_64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# appimage-builder recipe see https://appimage-builder.readthedocs.io for details
version: 1
script:
- rm -rf AppDir || true
- cp -r build/linux/*/release/bundle AppDir
- mkdir -p AppDir/usr/share/icons/hicolor/64x64/apps/
- cp assets/images/logo.png AppDir/usr/share/icons/hicolor/64x64/apps/
AppDir:
path: ./AppDir
app_info:
id: io.github.TaYaKi71751-gaming-config.gimimanager
name: GIMI Manager
icon: logo
version: latest
exec: gimimanager
exec_args: $@
apt:
arch: amd64
allow_unauthenticated: true
sources:
- sourceline: deb http://archive.ubuntu.com/ubuntu/ focal main restricted
- sourceline: deb http://archive.ubuntu.com/ubuntu/ focal-updates main restricted
- sourceline: deb http://archive.ubuntu.com/ubuntu/ focal universe
- sourceline: deb http://archive.ubuntu.com/ubuntu/ focal-updates universe
- sourceline: deb http://archive.ubuntu.com/ubuntu/ focal multiverse
- sourceline: deb http://archive.ubuntu.com/ubuntu/ focal-updates multiverse
- sourceline: deb http://archive.ubuntu.com/ubuntu/ focal-backports main restricted universe multiverse
- sourceline: deb http://security.ubuntu.com/ubuntu focal-security main restricted
- sourceline: deb http://security.ubuntu.com/ubuntu focal-security universe
- sourceline: deb http://security.ubuntu.com/ubuntu focal-security multiverse
include:
- libgtk-3-0
exclude:
- humanity-icon-theme
- hicolor-icon-theme
- adwaita-icon-theme
- ubuntu-mono
files:
include:
- lib/*.so
- data
exclude:
- usr/share/man
- usr/share/doc/*/README.*
- usr/share/doc/*/changelog.*
- usr/share/doc/*/NEWS.*
- usr/share/doc/*/TODO.*
runtime:
env:
GIO_MODULE_DIR: $APPDIR/usr/lib/x86_64-linux-gnu/gio/modules/
test:
fedora:
image: appimagecrafters/tests-env:fedora-30
command: ./gimimanager
use_host_x: true
debian:
image: appimagecrafters/tests-env:debian-stable
command: ./gimimanager
use_host_x: true
arch:
image: appimagecrafters/tests-env:archlinux-latest
command: ./gimimanager
use_host_x: true
centos:
image: appimagecrafters/tests-env:centos-7
command: ./gimimanager
use_host_x: true
ubuntu:
image: appimagecrafters/tests-env:ubuntu-xenial
command: ./gimimanager
use_host_x: true
AppImage:
arch: x86_64
update-information: guess
sign-key: None

0 comments on commit 422d895

Please sign in to comment.