Skip to content

Commit

Permalink
ci(build): Add build and release pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
Thogsit committed Oct 4, 2024
1 parent 78dbda5 commit 48ec64f
Show file tree
Hide file tree
Showing 3 changed files with 141 additions and 2 deletions.
119 changes: 119 additions & 0 deletions .github/workflows/build_and_release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
name: Build and Release Flutter Desktop Apps
# Workflow based on https://medium.com/illumination-curated/setting-up-ci-cd-for-flutter-desktop-applications-1f5fb2ab0bff

on:
workflow_dispatch: # Enable manual trigger

jobs:
linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: subosito/flutter-action@v1
with:
channel: 'stable'
- name: Install OS dependencies
run: sudo apt-get install -y clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev mpv libmpv-dev
- name: Install project dependencies
run: flutter pub get
- name: Generate intermediates
run: flutter pub run build_runner build --delete-conflicting-outputs
- name: Enable Linux build
run: flutter config --enable-linux-desktop
- name: Build artifacts
run: flutter build linux --release
- name: Package release files
uses: thedoctor0/zip-release@main
with:
type: 'zip'
filename: JellyBox-${{github.ref_name}}-linux.zip
directory: build/linux/x64/release/bundle
- name: Release to github
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{github.ref_name}}
files: build/linux/x64/release/bundle/JellyBox-${{github.ref_name}}-linux.zip

windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- uses: subosito/flutter-action@v1
with:
channel: 'stable'
- name: Install project dependencies
run: flutter pub get
- name: Generate intermediates
run: flutter pub run build_runner build --delete-conflicting-outputs
- name: Enable Windows build
run: flutter config --enable-windows-desktop
- name: Build artifacts
run: flutter build windows --release
- name: Package release
uses: thedoctor0/zip-release@master
with:
type: 'zip'
filename: JellyBox-${{github.ref_name}}-windows.zip
directory: build/windows/x64/runner/Release
- name: Release to github
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{github.ref_name}}
files: build/windows/x64/runner/Release/JellyBox-${{github.ref_name}}-windows.zip

android:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: subosito/flutter-action@v1
with:
channel: 'stable'
- name: Install project dependencies
run: flutter pub get
- name: Generate intermediates
run: flutter pub run build_runner build --delete-conflicting-outputs
- name: Build artifacts
run: flutter build apk --release
- name: Rename out apk
run: mv build/app/outputs/flutter-apk/app-release.apk build/app/outputs/flutter-apk/JellyBox-${{github.ref_name}}-android.apk
- name: Release to github
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{github.ref_name}}
files: build/app/outputs/flutter-apk/JellyBox-${{github.ref_name}}-android.apk

# Not working atm; set signing as described e.g. here in step 2.2) https://medium.com/@fluttergems/packaging-and-distributing-flutter-desktop-apps-the-missing-guide-part-1-macos-b36438269285
#macos:
# runs-on: macos-latest # macOS is required for building macOS apps
# steps:
# - uses: actions/checkout@v2
# - uses: subosito/flutter-action@v1
# with:
# channel: 'stable'
# - name: Install project dependencies
# run: flutter pub get
# - name: Generate intermediates
# run: flutter pub run build_runner build --delete-conflicting-outputs
# - name: Enable MacOS build
# run: flutter config --enable-macos-desktop
# - name: Build artifacts
# run: flutter build macos --release
# - name: Package release
# uses: thedoctor0/zip-release@master
# with:
# type: 'zip'
# filename: JellyBox-${{github.ref_name}}-macos.zip
# directory: build/macos/Build/Products/Release
# - name: Release to github
# uses: softprops/action-gh-release@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# tag_name: ${{github.ref_name}}
# files: build/macos/Build/Products/Release/JellyBox-${{github.ref_name}}-macos.zip
19 changes: 18 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,24 @@ By default apple restricts app from reading what user presses on keyboard. In or

## Android

While it can already be built and launched, I havent uploaded it to google play yet. This is something I plan to do soon. Meanwhile you can download APK from [releases](https://github.com/avdept/JellyBoxPlayer/releases)
While it can already be built and launched, I haven't uploaded it to google play yet. This is something I plan to do soon. Meanwhile you can download APK from [releases](https://github.com/avdept/JellyBoxPlayer/releases)

## Windows

The app is currently readily available via the "Releases" section as a binary file.

## Linux

The app is currently readily available via the "Releases" section as a binary file. Flatpak releases are coming soon.

### Build

On Linux, the build depends on `mpv` being installed on your host machine. Make sure it is, by running e.g. `mpv -h`.
To then build the app yourself, clone the repository and run:

```bash
flutter build linux --release
```

## Screenshots
<img align="right" width="380" src="./docs/4.PNG">
Expand Down
5 changes: 4 additions & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ dependencies:
window_manager: ^0.4.2
cupertino_icons: ^1.0.8
flutter_udid: ^3.0.0
#git: # Bumps the MacOS target platform from 10.11 to 10.14; remove when merged
# url: https://github.com/Thogsit/flutter_udid
# ref: master
dropdown_button2: ^2.3.9
flutter_svg: ^2.0.10+1
flutter_svg_provider: ^1.0.7
Expand All @@ -31,7 +34,7 @@ dependencies:
url: https://github.com/lvyueyang/just_audio_media_kit.git
ref: main
media_kit_libs_linux: any # Required dependency of just_audio_media_kit for Linux support
media_kit_native_event_loop: any
media_kit_native_event_loop: any # Seems to be required for exiting with audio running on Linux
cached_network_image: ^3.4.1
go_router: ^14.2.8
intl: ^0.19.0
Expand Down

0 comments on commit 48ec64f

Please sign in to comment.