mirror of
https://github.com/madari-media/madari-oss.git
synced 2026-04-19 09:02:05 +00:00
175 lines
4.4 KiB
YAML
175 lines
4.4 KiB
YAML
name: Build and Deploy
|
|
|
|
on:
|
|
push:
|
|
branches: [ "main" ]
|
|
pull_request:
|
|
branches: [ "main" ]
|
|
|
|
jobs:
|
|
build_windows:
|
|
runs-on: windows-latest
|
|
environment: prod
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Set up Flutter
|
|
uses: subosito/flutter-action@v2
|
|
with:
|
|
channel: 'stable'
|
|
|
|
- name: Install dependencies
|
|
run: flutter pub get
|
|
|
|
- name: Set up environment variables
|
|
run: |
|
|
touch .env
|
|
dart run build_runner build --delete-conflicting-outputs
|
|
|
|
- name: Build Windows
|
|
run: make build_windows
|
|
|
|
- name: Upload Windows artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: windows-build
|
|
path: build/windows/x64/runner/Release/
|
|
|
|
build_android:
|
|
runs-on: ubuntu-latest
|
|
environment: prod
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Set up Flutter
|
|
uses: subosito/flutter-action@v2
|
|
with:
|
|
channel: 'stable'
|
|
|
|
- uses: actions/setup-java@v4
|
|
with:
|
|
distribution: 'zulu'
|
|
java-version: '17'
|
|
|
|
- name: Install dependencies
|
|
run: flutter pub get
|
|
|
|
- name: Set up environment variables
|
|
run: |
|
|
touch .env
|
|
dart run build_runner build --delete-conflicting-outputs
|
|
|
|
- name: Create key.properties file
|
|
run: |
|
|
echo "storePassword=${{ secrets.STORE_PASSWORD }}" >> android/key.properties
|
|
echo "keyPassword=${{ secrets.KEY_PASSWORD }}" >> android/key.properties
|
|
echo "keyAlias=${{ secrets.KEY_ALIAS }}" >> android/key.properties
|
|
echo "storeFile=key.jks" >> android/key.properties
|
|
|
|
- name: Decode and save keystore file
|
|
run: |
|
|
echo "${{ secrets.STORE_FILE_BASE64 }}" | base64 --decode > android/app/key.jks
|
|
|
|
- name: Build Android
|
|
run: make build_android
|
|
|
|
- name: Upload Android artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: android-build
|
|
path: build/app/outputs/flutter-apk/app-release.apk
|
|
|
|
build_ipa:
|
|
runs-on: macos-latest
|
|
environment: prod
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Set up Flutter
|
|
uses: subosito/flutter-action@v2
|
|
with:
|
|
channel: stable
|
|
|
|
- name: Install dependencies
|
|
run: flutter pub get
|
|
|
|
- name: Set up environment variables
|
|
run: |
|
|
touch .env
|
|
dart run build_runner build --delete-conflicting-outputs
|
|
|
|
- name: Build iOS
|
|
run: flutter build ios --release --no-codesign
|
|
|
|
- name: Pack IPA
|
|
run: "mkdir build/ios/iphoneos/Payload && mv build/ios/iphoneos/Runner.app build/ios/iphoneos/Payload"
|
|
|
|
- name: Zip Ipa
|
|
run: "zip -qq -r -9 app.ipa build/ios/iphoneos/Payload"
|
|
|
|
- name: Upload iOS artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: ios-build
|
|
path: app.ipa
|
|
|
|
build_linux:
|
|
runs-on: ubuntu-latest
|
|
environment: prod
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Set up Flutter
|
|
uses: subosito/flutter-action@v2
|
|
with:
|
|
channel: stable
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
sudo apt-get update -y
|
|
sudo apt-get install -y ninja-build libgtk-3-dev libmpv-dev mpv
|
|
|
|
- name: Install dependencies
|
|
run: flutter pub get
|
|
|
|
- name: Set up environment variables
|
|
run: |
|
|
touch .env
|
|
dart run build_runner build --delete-conflicting-outputs
|
|
|
|
- name: Build Linux
|
|
run: flutter build linux --release
|
|
|
|
- name: Upload Linux artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: linux-build
|
|
path: build/linux/x64/release/bundle
|
|
|
|
build_macos:
|
|
runs-on: macos-latest
|
|
environment: prod
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Set up Flutter
|
|
uses: subosito/flutter-action@v2
|
|
with:
|
|
channel: stable
|
|
|
|
- name: Install dependencies
|
|
run: flutter pub get
|
|
|
|
- name: Set up environment variables
|
|
run: |
|
|
touch .env
|
|
dart run build_runner build --delete-conflicting-outputs
|
|
|
|
- name: Build MacOS
|
|
run: flutter build macos --release
|
|
|
|
- name: Upload MacOS artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: macos-build
|
|
path: build/macos/Build/Products/Release/Madari.app
|