Skip to content

Commit

Permalink
Create windows-build.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
bksubhuti committed Jun 19, 2023
1 parent 43ffb55 commit 6eee996
Showing 1 changed file with 128 additions and 0 deletions.
128 changes: 128 additions & 0 deletions .github/workflows/windows-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
name: Run TPR Builds Manually

on:
workflow_dispatch:

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]

steps:
- name: Checkout repository
uses: actions/checkout@v2

# Set up Flutter
- name: Install Flutter
uses: subosito/flutter-action@v1
with:
channel: 'stable'
flutter-version: 3.10.x

# Linux specific setup
- name: Install Linux dependencies
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt update
sudo apt-get install clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev libstdc++-12-dev libfuse2 -y
# Download the zip file
- name: Download zip file
run: curl -L -o assets/database/tipitaka_pali.zip https://dl.dropboxusercontent.com/s/svnrlo29dnblyad/tipitaka_pali.zip?dl=0

# Extract the zip file
- name: Extract zip file
run: unzip assets/database/tipitaka_pali.zip -d assets/database/

# Delete the original zip file
- name: Delete zip file
run: rm assets/database/tipitaka_pali.zip

# Run the split.sh script
- name: Run split.sh script
run: bash assets/database/split.sh

# Flutter build for Linux and Android
- name: Build Flutter project (Linux and Android)
if: matrix.os == 'ubuntu-latest'
run: |
flutter pub get
flutter build apk --release # For Android
flutter build linux --release # For Linux
# Copy build files into AppDir (Linux only)
- name: Copy build files into AppDir
if: matrix.os == 'ubuntu-latest'
run: |
cd TipitakaPaliReader.AppDir
cp -r ../build/linux/x64/release/bundle/* .
cd ..
# Download the AppImage tool (Linux only)
- name: Download AppImage tool
if: matrix.os == 'ubuntu-latest'
run: |
wget https://github.com/AppImage/AppImageKit/releases/download/13/appimagetool-x86_64.AppImage
chmod +x appimagetool-x86_64.AppImage
# Build the AppImage (Linux only)
- name: Build AppImage
if: matrix.os == 'ubuntu-latest'
run: ARCH=x86_64 ./appimagetool-x86_64.AppImage TipitakaPaliReader.AppDir/ tipitaka_pali_reader.AppImage

# Flutter build for Windows
- name: Build Flutter project (Windows)
if: matrix.os == 'windows-latest'
run: |
flutter pub get
flutter build windows --release # For Windows
- name: Download SQLite DLL
run: |
curl -sSL -o sqlite.zip https://www.sqlite.org/2023/sqlite-dll-win64-x64-3420000.zip
- name: Extract SQLite DLL
run: unzip sqlite.zip

- name: Copy SQLite DLL to Build Release (Windows)
if: matrix.os == 'windows-latest'
run: |
copy sqlite3.dll build\windows\runner\Release\
- name: Copy SQLite DLL to Build Release
run: |
dart run msix:create
# Upload Android APK
- name: Upload Android APK
if: matrix.os == 'ubuntu-latest'
uses: actions/upload-artifact@v2
with:
name: android-apk
path: build/app/outputs/flutter-apk/app-release.apk

# Upload Linux build
- name: Upload Linux build
if: matrix.os == 'ubuntu-latest'
uses: actions/upload-artifact@v2
with:
name: linux-build
path: build/linux/x64/release/bundle

# Upload AppImage
- name: Upload AppImage
if: matrix.os == 'ubuntu-latest'
uses: actions/upload-artifact@v2
with:
name: linux-appimage
path: tipitaka_pali_reader.AppImage

# Upload Windows build
- name: Upload Windows build
if: matrix.os == 'windows-latest'
uses: actions/upload-artifact@v2
with:
name: windows-build
path: build/windows/runner/Release

0 comments on commit 6eee996

Please sign in to comment.