Update flatpak_deploy.yml #13
Workflow file for this run
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: [push] | |
jobs: | |
build_flutter_app: | |
name: Build and compress Flutter App | |
runs-on: ubuntu-latest | |
outputs: | |
output1: ${{ steps.cprs.outputs.tarsha }} | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v3 | |
- name: Install Flutter dependencies | |
run: | | |
sudo apt update | |
sudo apt install -y clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev libstdc++-12-dev libsecret-1-dev | |
- name: Setup Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
channel: 'stable' | |
- name: Build Flutter Linux version | |
run: | | |
flutter pub get | |
flutter build linux | |
echo "VERSION=$(flutter pub run cider version)" >> $GITHUB_ENV | |
- name: Compress App | |
run: | | |
tar -czaf miria-$VERSION-amd64.tar.gz ./build/linux/x64/release/bundle/* | |
- id: cprs | |
run: | | |
echo "tarsha=$(sha256sum miria-$VERSION-amd64.tar.gz | grep -f 1)" >> $GITHUB_OUTPUT | |
- name: Upload artifact | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: gh release upload v$VERSION miria-$VERSION-amd64.tar.gz | |
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: | |
- env: | |
OUTPUT1: ${{ needs.build_flutter_app.outputs.output1 }} | |
- name: Checkout Code | |
uses: actions/checkout@v3 | |
- name: Setup build env | |
run: | | |
VERSION=$(cat pubspec.yaml | grep version | cut -d ' ' -f 2) | |
cp assets/images/icon.png assets/images/info.shiosyakeyakini.miria.png | |
sed -i "s|url: file_path|url: https://github.com/Npepperlinux/miria/releases/download/v$VERSION/miria-$VERSION-amd64.tar.gz|g" flatpak/info.shiosyakeyakini.miria.yml | |
sed -i "s|sha256: get-later|sha256: $OUTPUT1|g" flatpak/info.shiosyakeyakini.miria.yml | |
sed -i "s|ReplaceToCommand|tar -xf miria-$VERSION-amd64.tar.gz -C miria|g" flatpak/info.shiosyakeyakini.miria.yml | |
- name: Build .flatpak | |
uses: flatpak/flatpak-github-actions/flatpak-builder@v6 | |
with: | |
bundle: miria.flatpak | |
manifest-path: flatpak/info.shiosyakeyakini.miria.yml | |
- name: Upload Flatpak artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
path: miria.flatpak |