Skip to content

確認2

確認2 #22

Workflow file for this run

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/*
- name: Get checksum
id: cprs
run: |
echo "tarsha=$(sha256sum 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 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
- 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