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 3fa903a
Show file tree
Hide file tree
Showing 4 changed files with 260 additions and 95 deletions.
127 changes: 127 additions & 0 deletions .github/workflows/build_and_release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
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:
push:
branches:
- main # Always release the current main branch
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
- name: Set up JDK 17 # Required for the package_info_plus flutter package
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- 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 APKs from the [Releases](https://github.com/avdept/JellyBoxPlayer/releases) section.

## Windows

The app is currently available in the [Releases](https://github.com/avdept/JellyBoxPlayer/releases) section as a binary file.

## Linux

The app is currently available in the [Releases](https://github.com/avdept/JellyBoxPlayer/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
Loading

0 comments on commit 3fa903a

Please sign in to comment.