Files
umbrix/.github/workflows/ci.yml
2023-07-22 09:46:16 +02:00

136 lines
3.9 KiB
YAML

name: Build
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
permissions: write-all
concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
# - platform: android
# os: ubuntu-latest
# targets: aab,apk
# - platform: windows
# os: windows-latest
# aarch: amd64
# targets: exe
# - platform: windows
# os: windows-latest
# aarch: 386
# targets: exe
# - platform: linux
# os: ubuntu-latest
# aarch: 386
# targets: appimage
- platform: linux
os: ubuntu-latest
aarch: amd64
targets: appimage
runs-on: ${{ matrix.os }}
steps:
- name: checkout
uses: actions/checkout@v3
- name: Cache Flutter dependencies
uses: actions/cache@v2
with:
path: |
~/.pub-cache
key: ${{ runner.os }}-pub-cache-${{ hashFiles('**/pubspec.lock') }}
restore-keys: |
${{ runner.os }}-pub-cache-
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: '3.10.6'
channel: 'stable'
- name: Setup Java
if: matrix.platform == 'android'
uses: actions/setup-java@v3
with:
distribution: "zulu"
java-version: 11
- name: Setup Linux dependencies
if: matrix.platform == 'linux'
run: |
sudo apt install -y locate ninja-build pkg-config libgtk-3-dev libglib2.0-dev libgio2.0-cil-dev libayatana-appindicator3-dev fuse
sudo modprobe fuse
wget -O appimagetool "https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage"
chmod +x appimagetool
mv appimagetool /usr/local/bin/
- name: Setup Flutter Distributor
if: matrix.platform == 'windows' || matrix.platform == 'linux'
# shell: powershell
run: |
dart pub global activate flutter_distributor
- name: Get Dependencies
run: |
make get
- name: Generate
run: |
make gen
make translate
- name: Get Libs ${{ matrix.platform }}
run: |
make ${{ matrix.platform }}-libs
- name: Release ${{ matrix.platform }}
run: |
make ${{ matrix.platform }}-release
- name: Copy to out WINDOWS
if: matrix.platform == 'windows'
run: |
New-Item -ItemType Directory -Force -Name "out"
$EXT_ARRAY = "${{ matrix.targets }}" -split ","
foreach ($EXT in $EXT_ARRAY) {
# Find all files with this extension in the current directory, and copy them to "out" directory
Get-ChildItem -Recurse -File -Filter "*.$EXT" | Copy-Item -Destination "out" -ErrorAction SilentlyContinue
}
- name: Copy to out unix
if: matrix.platform != 'windows'
run: |
mkdir out
IFS=',' read -r -a EXT_ARRAY <<< "${{ matrix.targets }}"
# Loop over extensions
for EXT in "${EXT_ARRAY[@]}"; do
# Find all files with this extension in SRC_DIR, and copy them to DST_DIR
find "." -type f -name "*.$EXT" -exec cp {} "out" \;
done
- uses: actions/upload-artifact@v3
with:
name: ${{ matrix.platform }}
path: ./out
retention-days: 2
- name: Create or Update Draft Release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: ./out/*
name: "draft"
tag_name: "draft"
prerelease: true
overwrite: true