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 69cb770
Show file tree
Hide file tree
Showing 2 changed files with 100 additions and 1 deletion.
96 changes: 96 additions & 0 deletions .github/workflows/build_and_release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
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

# 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
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 69cb770

Please sign in to comment.