Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
170 changes: 17 additions & 153 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,167 +1,31 @@
# This is a sample build configuration for GitHub Actions

name: Build

on:
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
paths-ignore:
- "**.md"
workflow_dispatch:
inputs:
build_android:
description: "Build Android"
required: false
default: true
type: boolean
build_ios:
description: "Build iOS"
required: false
default: false
type: boolean
build_mac:
description: "Build Mac"
required: false
default: false
type: boolean
build_win_x64:
description: "Build Win-x64"
description: 'Set to true to build for Mac'
required: false
default: false
type: boolean
build_linux_x64:
description: "Build Linux-x64"
required: false
default: false
type: boolean
tag:
description: "tag"
required: false
default: ""
type: string
default: 'false'

jobs:
android:
if: ${{ (github.event_name == 'pull_request' && github.repository == 'Starfallan/PiliNara') || github.event.inputs.build_android == 'true' }}
name: Release Android
runs-on: ubuntu-latest
permissions: write-all

mac:
if: ${{ (github.event_name == 'pull_request' && github.repository == 'Starfallan/PiliNara') || github.event.inputs.build_mac == 'true' }}
runs-on: macos-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
fetch-depth: 0

- name: Setup Java
uses: actions/setup-java@v5
with:
distribution: "zulu"
java-version: "17"
cache: "gradle"
cache-dependency-path: |
android/*.gradle*
android/**/gradle-wrapper.properties

- name: Setup Flutter
uses: subosito/flutter-action@v2
id: flutter-action
with:
channel: stable
flutter-version-file: pubspec.yaml
cache: true

- name: Apply Patch
shell: pwsh
run: lib/scripts/patch.ps1 android
continue-on-error: true

- name: Write key
if: github.event_name == 'workflow_dispatch'
run: |
if [ ! -z "${{ secrets.SIGN_KEYSTORE_BASE64 }}" ]; then
echo "${{ secrets.SIGN_KEYSTORE_BASE64 }}" | base64 --decode > android/app/key.jks
echo storeFile='key.jks' >> android/key.properties
echo storePassword='${{ secrets.KEYSTORE_PASSWORD }}' >> android/key.properties
echo keyAlias='${{ secrets.KEY_ALIAS }}' >> android/key.properties
echo keyPassword='${{ secrets.KEY_PASSWORD }}' >> android/key.properties
fi
uses: actions/checkout@v2

- name: Set and Extract version
shell: pwsh
run: lib/scripts/build.ps1 android
- name: Run build
run: echo "Building for macOS..."

- name: Flutter Build Release Apk (Manual)
if: ${{ github.event_name == 'workflow_dispatch' }}
run: flutter build apk --release --split-per-abi --dart-define-from-file=pili_release.json --pub

- name: Flutter Build Dev Apk (PR)
if: ${{ github.event_name == 'pull_request' }}
run: flutter build apk --release --split-per-abi --android-project-arg dev=1 --pub

- name: Rename APKs
shell: bash
run: |
for file in build/app/outputs/flutter-apk/app-*-release.apk; do
abi=$(echo "$file" | sed -E 's|.*app-(.*)-release\.apk|\1|')
mv "$file" "PiliNara_android_${{ env.version }}_${abi}.apk"
done

- name: Release to GitHub
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.tag != '' }}
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.event.inputs.tag }}
name: ${{ github.event.inputs.tag }}
files: PiliNara_android_*.apk

- name: Upload arm64-v8a
uses: actions/upload-artifact@v7
with:
archive: false
name: Android_arm64-v8a
path: PiliNara_android_*_arm64-v8a.apk

- name: Upload armeabi-v7a
uses: actions/upload-artifact@v7
with:
archive: false
name: Android_armeabi-v7a
path: PiliNara_android_*_armeabi-v7a.apk

- name: Upload x86_64
uses: actions/upload-artifact@v7
with:
archive: false
name: Android_x86_64
path: PiliNara_android_*_x86_64.apk

ios:
if: ${{ (github.event_name == 'pull_request' && github.repository == 'Starfallan/PiliNara') || github.event.inputs.build_ios == 'true' }}
uses: ./.github/workflows/ios.yml
permissions: write-all
with:
tag: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.tag || '' }}

mac:
if: ${{ github.event.inputs.build_mac == 'true' }}
uses: ./.github/workflows/mac.yml
permissions: write-all
with:
tag: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.tag || '' }}

win_x64:
if: ${{ (github.event_name == 'pull_request' && github.repository == 'Starfallan/PiliNara') || github.event.inputs.build_win_x64 == 'true' }}
uses: ./.github/workflows/win_x64.yml
permissions: write-all
with:
tag: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.tag || '' }}
linux:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

linux_x64:
if: ${{ github.event.inputs.build_linux_x64 == 'true' }}
uses: ./.github/workflows/linux_x64.yml
permissions: write-all
with:
tag: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.tag || '' }}
- name: Run build
run: echo "Building for Linux..."
4 changes: 2 additions & 2 deletions macos/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.14;
MACOSX_DEPLOYMENT_TARGET = 11.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = macosx;
Expand Down Expand Up @@ -531,7 +531,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.14;
MACOSX_DEPLOYMENT_TARGET = 11.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = macosx;
SWIFT_COMPILATION_MODE = wholemodule;
Expand Down
Loading