attempt fix deploys #295
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: Flutter Build Release | |
on: | |
push: | |
branches: | |
- dev | |
tags: | |
- '*' | |
env: | |
FLUTTER_VERSION: '3.24.3' | |
IS_PRERELEASE: ${{ startsWith(github.ref, 'refs/tags/') && 'false' || 'true' }} | |
RELEASE_TAG: ${{ startsWith(github.ref, 'refs/tags/') && github.ref_name || 'latest' }} | |
jobs: | |
cancel: | |
name: Cancel Previous Runs | |
runs-on: ubuntu-latest | |
steps: | |
- uses: styfle/cancel-workflow-action@0.9.1 | |
with: | |
access_token: ${{ github.token }} | |
android: | |
needs: cancel | |
name: Build APK | |
runs-on: ubuntu-latest | |
env: | |
FLUTTER_KEY_ALIAS: ${{ secrets.FLUTTER_KEY_ALIAS }} | |
FLUTTER_KEY_PASSWORD: ${{ secrets.FLUTTER_KEY_PASSWORD }} | |
FLUTTER_STORE_PASSWORD: ${{ secrets.FLUTTER_STORE_PASSWORD }} | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' # or 'zulu', depending on your preference | |
java-version: '17' | |
- name: Cache Flutter SDK and dependencies | |
uses: actions/cache@v2 | |
with: | |
path: | | |
~/.pub-cache | |
~/.flutter | |
key: ${{ runner.os }}-flutter-${{ env.FLUTTER_VERSION }}-${{ hashFiles('**/pubspec.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-flutter-${{ env.FLUTTER_VERSION }}- | |
- name: Setup Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: ${{ env.FLUTTER_VERSION }} | |
- name: Decode Keystore | |
run: echo "${{ secrets.FLUTTER_STORE_FILE }}" | base64 -d > android/app/release-key.jks | |
- name: Install Dependencies | |
run: flutter pub get | |
- name: Build APK | |
run: | | |
flutter build apk --release | |
- name: Rename APK | |
run: mv build/app/outputs/flutter-apk/app-release.apk build/app/outputs/flutter-apk/InnerBreeze.apk | |
- name: Upload APKs as Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: apk-artifacts | |
path: | | |
build/app/outputs/flutter-apk/InnerBreeze.apk | |
linux: | |
needs: cancel | |
name: Build Linux | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
- name: Cache Flutter SDK | |
uses: actions/cache@v2 | |
with: | |
path: | | |
~/.pub-cache | |
~/.flutter | |
key: ${{ runner.os }}-flutter-${{ env.FLUTTER_VERSION }}-${{ hashFiles('**/pubspec.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-flutter-${{ env.FLUTTER_VERSION }}- | |
- name: Install Dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y \ | |
clang \ | |
cmake \ | |
ninja-build \ | |
pkg-config \ | |
libgtk-3-dev \ | |
libunwind-dev \ | |
liborc-dev \ | |
liblzma-dev \ | |
gstreamer1.0-plugins-base \ | |
gstreamer1.0-libav \ | |
gstreamer1.0-plugins-good \ | |
gstreamer1.0-plugins-bad \ | |
gstreamer1.0-plugins-ugly \ | |
libgstreamer1.0-dev \ | |
libgstreamer-plugins-base1.0-dev \ | |
libpangocairo-1.0-0 \ | |
libpango-1.0-0 \ | |
libharfbuzz0b \ | |
libatk1.0-0 \ | |
libcairo-gobject2 \ | |
libcairo2 | |
- name: Setup Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: ${{ env.FLUTTER_VERSION }} | |
- name: Install Dependencies | |
run: flutter pub get | |
- name: Build Linux Executable | |
run: | | |
flutter build linux --release | |
- name: Create AppImage | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y libfuse2 | |
# Download appimagetool from GitHub | |
wget "https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage" | |
chmod a+x appimagetool-x86_64.AppImage | |
# Make Appdir | |
cp -r build/linux/x64/release/bundle InnerBreeze.AppDir | |
# Add the AppRun script | |
echo -e '#!/bin/bash\ncurrent_dir="$(dirname "$(readlink -f "$0")")"\n"$current_dir/inner_breeze"' > InnerBreeze.AppDir/AppRun | |
chmod +x InnerBreeze.AppDir/AppRun | |
# Copy the existing desktop file | |
cp snap/gui/io.naox.InnerBreeze.desktop InnerBreeze.AppDir/InnerBreeze.desktop | |
cp snap/gui/io.naox.InnerBreeze.png InnerBreeze.AppDir/io.naox.InnerBreeze.png | |
# Debug output | |
echo "Contents of InnerBreeze.AppDir:" | |
ls -R InnerBreeze.AppDir | |
./appimagetool-x86_64.AppImage InnerBreeze.AppDir | |
# Debug output | |
echo "Contents of current directory:" | |
ls -l | |
# Verify AppImage creation | |
if [ -f InnerBreeze-x86_64.AppImage ]; then | |
echo "AppImage created successfully" | |
else | |
echo "AppImage creation failed" | |
exit 1 | |
fi | |
- name: Archive Linux executable | |
run: | | |
mkdir -p organized_output/InnerBreeze-x86_64/ | |
mv build/linux/x64/release/bundle/* organized_output/InnerBreeze-x86_64/ | |
cp -r metadata organized_output/InnerBreeze-x86_64/ | |
cp -r snap organized_output/InnerBreeze-x86_64/ | |
cd organized_output | |
tar -czf ../InnerBreeze-Linux-x86_64.tar.gz InnerBreeze-x86_64/ | |
- name: Upload Linux Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: linux-artifacts | |
path: | | |
InnerBreeze-Linux-x86_64.tar.gz | |
InnerBreeze-x86_64.AppImage | |
release: | |
name: Release Builds | |
needs: [android, linux] | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
- name: Download APK Artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: apk-artifacts | |
path: build/app/outputs/flutter-apk/ | |
- name: Download Linux Artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: linux-artifacts | |
path: build/linux/ | |
- name: Create Release and Upload Builds | |
uses: "marvinpinto/action-automatic-releases@latest" | |
with: | |
repo_token: "${{ secrets.GITHUB_TOKEN }}" | |
automatic_release_tag: "${{ env.RELEASE_TAG }}" | |
prerelease: "${{ env.IS_PRERELEASE }}" | |
title: "${{ env.RELEASE_TAG }}" | |
files: | | |
build/app/outputs/flutter-apk/InnerBreeze.apk | |
build/linux/InnerBreeze-Linux-x86_64.tar.gz | |
build/linux/InnerBreeze-x86_64.AppImage |