Build Flatpak #11
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build Flatpak | |
on: | |
workflow_dispatch: | |
#push: | |
# branches: | |
# - master | |
#concurrency: | |
# group: ci-release-${{ github.ref }}-1 | |
# cancel-in-progress: true | |
env: | |
project-id: com.invoiceninja.app | |
jobs: | |
build-flutter-app: | |
name: Build Flutter | |
env: | |
api_secret: ${{ secrets.api_secret }} | |
commit_secret: ${{ secrets.commit_secret }} | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Install Flutter dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y libgtk-3-dev libx11-dev pkg-config cmake ninja-build libblkid-dev | |
- name: Setup Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: '3.13.6' | |
#channel: 'stable' | |
- name: Init Flutter | |
run: | | |
flutter doctor -v | |
flutter pub get | |
- name: Prepare App | |
run: | | |
cp lib/.env.dart.example lib/.env.dart | |
sed -i 's/secret/${{ secrets.api_secret }}/g' lib/.env.dart | |
echo "const FLUTTER_VERSION = const <String, String>" > lib/flutter_version.dart | |
flutter --version --machine >> lib/flutter_version.dart | |
echo ";" >> lib/flutter_version.dart | |
- name: Build Flutter linux version | |
run: | | |
archiveName=Invoice-Ninja-Linux-Portable.tar.gz | |
baseDir=$(pwd) | |
flutter build linux | |
cd build/linux/x64/release/bundle || exit | |
tar -czaf $archiveName ./* | |
mv $archiveName "$baseDir"/ | |
- name: Upload app archive to workflow | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Invoice-Ninja-Archive | |
path: Invoice-Ninja-Linux-Portable.tar.gz | |
- name: Download artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
path: artifacts | |
- name: Create Release | |
uses: marvinpinto/[email protected] | |
with: | |
repo_token: "${{ secrets.commit_secret }}" | |
draft: false | |
prerelease: false | |
title: "Latest Release" | |
automatic_release_tag: "v5.0.128" | |
files: | | |
${{ github.workspace }}/artifacts/Invoice-Ninja-Archive | |
# build-flatpak: | |
# name: Build flatpak | |
# needs: build-flutter-app | |
# runs-on: ubuntu-latest | |
# container: | |
# image: bilelmoussaoui/flatpak-github-actions:freedesktop-22.08 | |
# options: --privileged | |
# steps: | |
# - name: Checkout code | |
# uses: actions/checkout@v3 | |
# | |
# - name: Build .flatpak | |
# uses: bilelmoussaoui/flatpak-github-actions/flatpak-builder@v5 | |
# with: | |
# bundle: FlutterApp.flatpak | |
# manifest-path: flathub_repo/com.example.FlutterApp.yml | |
# | |
# - name: Upload .flatpak artifact to workflow | |
# uses: actions/upload-artifact@v3 | |
# with: | |
# name: Flatpak artifact | |
# path: FlutterApp.flatpak |