rename #31
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: | | |
cd build/linux/x64/release/bundle | |
tar -czaf miria-$VERSION-amd64.tar.gz * | |
- name: Get checksum | |
id: cprs | |
run: | | |
echo "tarsha=$(sha256sum build/linux/x64/release/bundle/miria-$VERSION-amd64.tar.gz | cut -d ' ' -f 1)" >> $GITHUB_OUTPUT | |
- name: Upload artifact | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: gh release upload v$VERSION build/linux/x64/release/bundle/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: | |
- name: Checkout Code | |
uses: actions/checkout@v3 | |
- name: Setup build env | |
env: | |
OUTPUT1: ${{ needs.build_flutter_app.outputs.output1 }} | |
run: | | |
VERSION=$(cat pubspec.yaml | grep version | cut -d ' ' -f 2) | |
chmod 777 flatpak/build-flatpak.sh | |
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/build-flatpak.sh | |
cat flatpak/build-flatpak.sh | |
- 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 |