mirror of
https://github.com/madari-media/madari-oss.git
synced 2026-04-20 18:22:04 +00:00
83 lines
2 KiB
YAML
83 lines
2 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:
|
|
flutter-version: '3.27.1'
|
|
channel: 'stable'
|
|
|
|
- name: Install dependencies
|
|
run: flutter pub get
|
|
|
|
- name: Touch .env
|
|
run: touch .env
|
|
|
|
- run: make build
|
|
|
|
- name: Build Windows
|
|
run: make build_windows
|
|
|
|
- name: Upload Windows artifact
|
|
uses: actions/upload-artifact@v3
|
|
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:
|
|
flutter-version: '3.27.1'
|
|
channel: 'stable'
|
|
|
|
- uses: actions/setup-java@v4
|
|
with:
|
|
distribution: 'zulu'
|
|
java-version: '17'
|
|
|
|
- name: Install dependencies
|
|
run: flutter pub get
|
|
|
|
- name: Touch .env
|
|
run: touch .env
|
|
|
|
- run: make build
|
|
|
|
- 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/key.jks
|
|
|
|
- name: Build Android
|
|
run: make build_android
|
|
|
|
- name: Upload Android artifact
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: android-build
|
|
path: build/app/outputs/flutter-apk/app-release.apk
|