-
Notifications
You must be signed in to change notification settings - Fork 15
chore: Added app builds for Windows, macOS, Linux #217
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Vishveshwara
wants to merge
8
commits into
fossasia:main
Choose a base branch
from
Vishveshwara:app_build
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
287849c
chore: Added app builds for Windows, macOS, Debian, Web
Vishveshwara 93ef86f
Updated macOS Podfile to fix build error
Vishveshwara cdc55db
Updated MACOSX_DEPLOYMENT_TARGET
Vishveshwara 6d3fe94
Merge branch 'main' into app_build
mariobehling caab7f9
fixed uploading packages to app branch
Vishveshwara efd8b52
Merge branch 'app_build' of https://github.com/Vishveshwara/magic-epa…
Vishveshwara bc366d4
branch name fix
Vishveshwara 6f6e81f
Changed Linux directory name for packages
Vishveshwara File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
Vishveshwara marked this conversation as resolved.
Show resolved
Hide resolved
Vishveshwara marked this conversation as resolved.
Show resolved
Hide resolved
|
||
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
Vishveshwara marked this conversation as resolved.
Show resolved
Hide resolved
Vishveshwara marked this conversation as resolved.
Show resolved
Hide resolved
|
||
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
@@ -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 | ||
|
||
|
@@ -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 | ||
|
||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
||
|
@@ -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 | ||
|
||
|
@@ -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 | ||
|
||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.