Skip to content
Open
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
64 changes: 64 additions & 0 deletions .github/actions/linux/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: "Linux Workflow"

inputs:
VERSION_NAME:
description: 'Version Name to be used for build'
required: false
default: '1.0.0'
VERSION_CODE:
description: 'Version Code to be used for build'
required: true
default: '1'

runs:
using: "composite"
steps:
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
cache: true
flutter-version-file: pubspec.yaml

- name: Install dependencies
shell: bash
run: |
sudo apt-get update
sudo apt-get install -y \
clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev

- name: Build Linux App
shell: bash
run: |
flutter config --enable-linux-desktop
flutter build linux --build-name ${{ inputs.VERSION_NAME }} --build-number ${{ inputs.VERSION_CODE }}
- name: Install fpm
shell: bash
run: |
sudo apt-get install -y ruby ruby-dev build-essential
sudo gem install --no-document fpm

- name: Build .deb package
shell: bash
run: |
mkdir -p build/linux/package/usr/local/bin
cp -r ./build/linux/x64/release/bundle/* build/linux/package/usr/local/bin/
fpm -s dir -t deb \
-n magicepaper \
-v ${{ inputs.VERSION_NAME }} \
--prefix=/ \
-C build/linux/package \
usr
- name: Build .rpm package
shell: bash
run: |
fpm -s dir -t rpm \
-n magicepaper \
-v ${{ inputs.VERSION_NAME }} \
--prefix=/ \
-C build/linux/package \
usr
- name: Store Packages
uses: actions/upload-artifact@v4
with:
name: linux-packages
path: "*.deb\n*.rpm"
42 changes: 42 additions & 0 deletions .github/actions/macos/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: "macOS Workflow"

inputs:
VERSION_NAME:
description: 'Version Name to be used for build'
required: false
default: '1.0.0'
VERSION_CODE:
description: 'Version Code to be used for build'
required: true
default: '1'

runs:
using: "composite"
steps:
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
cache: true
flutter-version-file: pubspec.yaml

- name: Update Podfile
shell: bash
run: |
cd ./macos
flutter pub get
pod install --repo-update

- name: Build macOS App
shell: bash
env:
VERSION_NAME: ${{ inputs.VERSION_NAME }}
VERSION_CODE: ${{ inputs.VERSION_CODE }}
run: |
flutter config --enable-macos-desktop
flutter build macos --build-name $VERSION_NAME --build-number $VERSION_CODE

- name: Store App file
uses: actions/upload-artifact@v4
with:
name: macos-app
path: build/macos/Build/Products/Release/magicepaper.app
28 changes: 28 additions & 0 deletions .github/actions/windows/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: "Windows Workflow"

inputs:
VERSION_NAME:
description: 'Version Name to be used for build'
required: false
default: '1.0.0'
VERSION_CODE:
description: 'Version Code to be used for build'
required: true
default: '1'

runs:
using: "composite"
steps:
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
cache: true
flutter-version-file: pubspec.yaml

- name: Build Windows App
shell: bash
env:
VERSION_NAME: ${{ inputs.VERSION_NAME }}
VERSION_CODE: ${{ inputs.VERSION_CODE }}
run: |
flutter build windows --build-name $VERSION_NAME --build-number $VERSION_CODE
37 changes: 34 additions & 3 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,44 @@ jobs:
- name: Set up Xcode
uses: maxim-lobanov/[email protected]
with:
xcode-version: latest-stable
xcode-version: '16.4.0'

- uses: actions/checkout@v4

- name: iOS Workflow
uses: ./.github/actions/ios


macos:
name: macOS Flutter Build
needs: common
runs-on: macos-latest
steps:
- uses: actions/checkout@v4

- name: macOS Workflow
uses: ./.github/actions/macos

windows:
name: Windows Flutter Build
needs: common
runs-on: windows-latest
steps:
- uses: actions/checkout@v4

- name: Windows Workflow
uses: ./.github/actions/windows

linux:
name: Linux Flutter Build
needs: common
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Linux Workflow
uses: ./.github/actions/linux

screenshots-android:
name: Screenshots (Android)
runs-on: ubuntu-latest
Expand All @@ -81,7 +112,7 @@ jobs:
- name: Set up Xcode
uses: maxim-lobanov/[email protected]
with:
xcode-version: latest-stable
xcode-version: '16.4.0'

- uses: actions/checkout@v4

Expand All @@ -98,7 +129,7 @@ jobs:
- name: Set up Xcode
uses: maxim-lobanov/[email protected]
with:
xcode-version: latest-stable
xcode-version: '16.4.0'

- uses: actions/checkout@v4

Expand Down
130 changes: 126 additions & 4 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ jobs:
- name: Set up Xcode
uses: maxim-lobanov/[email protected]
with:
xcode-version: latest-stable
xcode-version: '16.4.0'

- uses: actions/checkout@v4

Expand Down Expand Up @@ -246,7 +246,7 @@ jobs:
- name: Set up Xcode
uses: maxim-lobanov/[email protected]
with:
xcode-version: latest-stable
xcode-version: '16.4.0'

- uses: actions/checkout@v4

Expand All @@ -263,11 +263,133 @@ jobs:
- name: Set up Xcode
uses: maxim-lobanov/[email protected]
with:
xcode-version: latest-stable
xcode-version: '16.4.0'

- uses: actions/checkout@v4

- name: iPad Screenshot Workflow
uses: ./.github/actions/screenshot-ipad
with:
IPAD_DEVICE_MODEL: ${{ env.IPAD_DEVICE_MODEL }}
IPAD_DEVICE_MODEL: ${{ env.IPAD_DEVICE_MODEL }}


linux:
name: Linux Flutter Build
needs: common
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Linux Workflow
uses: ./.github/actions/linux
with:
VERSION_NAME: ${{needs.common.outputs.VERSION_NAME}}
VERSION_CODE: ${{needs.common.outputs.VERSION_CODE}}

- name: Upload packages to app branch
if: ${{ github.repository == 'fossasia/magic-epaper-app' }}
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"

git clone --branch=app https://${{ github.repository_owner }}:${{ github.token }}@github.com/${{ github.repository }} app
cd app

branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}

echo "Removing previous files from branch"

rm -rf *.deb *.rpm

echo "Copying new build files"

cp -v ../*.deb .
cp -v ../*.rpm .

echo "Pushing to app branch"

git checkout --orphan temporary
git add --all .
git commit -am "[Auto] Update Linux Packages from $branch ($(date +%Y-%m-%d.%H:%M:%S))"
git branch -D app
git branch -m app
git push --force origin app

macos:
name: macOS Flutter Build
needs: common
runs-on: macos-latest
steps:
- uses: actions/checkout@v4

- name: macOS Workflow
uses: ./.github/actions/macos
with:
VERSION_NAME: ${{ needs.common.outputs.VERSION_NAME }}
VERSION_CODE: ${{ needs.common.outputs.VERSION_CODE }}

- name: Upload macOS Build
uses: actions/upload-artifact@v4
with:
name: macOS Build
path: build/macos/Build/Products/Release/

- name: Push macOS Build to app branch
shell: bash
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git clone --branch=app https://${{ github.repository_owner }}:${{ github.token }}@github.com/${{ github.repository }} app
cd app
branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}
# Copy all macOS build artifacts to root
cp -r ../build/macos/Build/Products/Release/* .
git checkout --orphan temporary
git add --all
git commit -m "[Auto] Update macOS build from $branch ($(date +%Y-%m-%d.%H:%M:%S))"
git branch -D app
git branch -m app
git push --force origin app
windows:
name: Windows Flutter Build
needs: common
runs-on: windows-latest
steps:
- uses: actions/checkout@v4

- name: Windows Workflow
uses: ./.github/actions/windows
with:
VERSION_NAME: ${{needs.common.outputs.VERSION_NAME}}
VERSION_CODE: ${{needs.common.outputs.VERSION_CODE}}

- name: Upload installer to app branch
if: ${{ github.repository == 'fossasia/magic-epaper-app' }}
shell: bash
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"

git clone --branch=app https://${{ github.repository_owner }}:${{ github.token }}@github.com/${{ github.repository }} app
cd app

branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}

echo "Removing previous files from branch"

rm -rf *.exe

echo "Copying new build files"

cp -v ../build/windows/x64/installer/Release/*.exe .

echo "Pushing to app branch"

git checkout --orphan temporary
git add --all .
git commit -am "[Auto] Update Windows Installer's from $branch ($(date +%Y-%m-%d.%H:%M:%S))"
git branch -D app
git branch -m app
git push --force origin app


2 changes: 1 addition & 1 deletion macos/Podfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
platform :osx, '10.14'
platform :osx, '11.0'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
Expand Down
6 changes: 3 additions & 3 deletions macos/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,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 Expand Up @@ -543,7 +543,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 @@ -593,7 +593,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