From 287849cce5312f7c082f6ab187a6cbff55f40323 Mon Sep 17 00:00:00 2001 From: Vishveshwara Date: Mon, 8 Sep 2025 13:09:44 +0530 Subject: [PATCH 1/6] chore: Added app builds for Windows, macOS, Debian, Web --- .github/actions/debian/action.yml | 43 +++++++++ .github/actions/macos/action.yml | 28 ++++++ .github/actions/web/action.yml | 28 ++++++ .github/actions/windows/action.yml | 28 ++++++ .github/workflows/pull_request.yml | 41 ++++++++ .github/workflows/push.yml | 144 ++++++++++++++++++++++++++++- 6 files changed, 311 insertions(+), 1 deletion(-) create mode 100644 .github/actions/debian/action.yml create mode 100644 .github/actions/macos/action.yml create mode 100644 .github/actions/web/action.yml create mode 100644 .github/actions/windows/action.yml diff --git a/.github/actions/debian/action.yml b/.github/actions/debian/action.yml new file mode 100644 index 00000000..a289434b --- /dev/null +++ b/.github/actions/debian/action.yml @@ -0,0 +1,43 @@ +name: "Debian 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 Linux dependencies + shell: bash + run: | + sudo apt-get update + sudo apt-get install -y \ + libgtk-3-dev \ + liblzma-dev \ + clang \ + cmake \ + ninja-build \ + pkg-config \ + libglib2.0-dev \ + libblkid-dev \ + libgcrypt20-dev + + - name: Build Linux (Debian) App + shell: bash + env: + VERSION_NAME: ${{ inputs.VERSION_NAME }} + VERSION_CODE: ${{ inputs.VERSION_CODE }} + run: | + flutter build linux --build-name $VERSION_NAME --build-number $VERSION_CODE \ No newline at end of file diff --git a/.github/actions/macos/action.yml b/.github/actions/macos/action.yml new file mode 100644 index 00000000..e8d2b0e8 --- /dev/null +++ b/.github/actions/macos/action.yml @@ -0,0 +1,28 @@ +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: Build macOS App + shell: bash + env: + VERSION_NAME: ${{ inputs.VERSION_NAME }} + VERSION_CODE: ${{ inputs.VERSION_CODE }} + run: | + flutter build macos --build-name $VERSION_NAME --build-number $VERSION_CODE \ No newline at end of file diff --git a/.github/actions/web/action.yml b/.github/actions/web/action.yml new file mode 100644 index 00000000..008e7436 --- /dev/null +++ b/.github/actions/web/action.yml @@ -0,0 +1,28 @@ +name: "Web 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 Web App + shell: bash + env: + VERSION_NAME: ${{ inputs.VERSION_NAME }} + VERSION_CODE: ${{ inputs.VERSION_CODE }} + run: | + flutter build web --release --build-name $VERSION_NAME --build-number $VERSION_CODE diff --git a/.github/actions/windows/action.yml b/.github/actions/windows/action.yml new file mode 100644 index 00000000..a038ad3d --- /dev/null +++ b/.github/actions/windows/action.yml @@ -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 \ No newline at end of file diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index ee3b81c6..0182c455 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -60,6 +60,47 @@ jobs: - 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 + + debian: + name: Debian Flutter Build + needs: common + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Debian Workflow + uses: ./.github/actions/debian + + web: + name: Web Flutter Build + needs: common + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Web Workflow + uses: ./.github/actions/web + screenshots-android: name: Screenshots (Android) runs-on: ubuntu-latest diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 5ee2272e..fb994e55 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -270,4 +270,146 @@ jobs: - name: iPad Screenshot Workflow uses: ./.github/actions/screenshot-ipad with: - IPAD_DEVICE_MODEL: ${{ env.IPAD_DEVICE_MODEL }} \ No newline at end of file + IPAD_DEVICE_MODEL: ${{ env.IPAD_DEVICE_MODEL }} + + + debian: + name: Debian Flutter Build + needs: common + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Debian Workflow + uses: ./.github/actions/debian + with: + VERSION_NAME: ${{ needs.common.outputs.VERSION_NAME }} + VERSION_CODE: ${{ needs.common.outputs.VERSION_CODE }} + + - name: Upload Debian Build + uses: actions/upload-artifact@v4 + with: + name: Debian Build + path: build/linux/x64/release/bundle/ + + - name: Push Debian 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/}} + cp -r ../build/linux/x64/release/bundle/* . + git checkout --orphan temporary + git add --all + git commit -m "[Auto] Update Debian build 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 Windows Build + uses: actions/upload-artifact@v4 + with: + name: Windows Build + path: build/windows/x64/runner/Release/ + + - name: Push Windows 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 Windows build artifacts to root + cp -r ../build/windows/x64/runner/Release/* . + git checkout --orphan temporary + git add --all + git commit -m "[Auto] Update Windows build from $branch ($(date +%Y-%m-%d.%H:%M:%S))" + git branch -D app + git branch -m app + git push --force origin app + +web: + name: Web Flutter Build + needs: common + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Web Workflow + uses: ./.github/actions/web + with: + VERSION_NAME: ${{ needs.common.outputs.VERSION_NAME }} + VERSION_CODE: ${{ needs.common.outputs.VERSION_CODE }} + + - name: Upload Web Build + uses: actions/upload-artifact@v4 + with: + name: Web Build + path: build/web + + - name: Push Web 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 Web build artifacts to root + cp -r ../build/web/* . + git checkout --orphan temporary + git add --all + git commit -m "[Auto] Update Web build from $branch ($(date +%Y-%m-%d.%H:%M:%S))" + git branch -D app + git branch -m app + git push --force origin app From 93ef86fb2ed8790f553b7a64787b856e50f47002 Mon Sep 17 00:00:00 2001 From: Vishveshwara Date: Mon, 8 Sep 2025 13:45:12 +0530 Subject: [PATCH 2/6] Updated macOS Podfile to fix build error --- macos/Podfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/macos/Podfile b/macos/Podfile index 29c8eb32..a46f7f23 100644 --- a/macos/Podfile +++ b/macos/Podfile @@ -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' From cdc55db0474822fd29663c462b03b17d4f5e9278 Mon Sep 17 00:00:00 2001 From: Vishveshwara Date: Mon, 8 Sep 2025 17:44:25 +0530 Subject: [PATCH 3/6] Updated MACOSX_DEPLOYMENT_TARGET --- macos/Runner.xcodeproj/project.pbxproj | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/macos/Runner.xcodeproj/project.pbxproj b/macos/Runner.xcodeproj/project.pbxproj index 6a52f1d2..4250c5b9 100644 --- a/macos/Runner.xcodeproj/project.pbxproj +++ b/macos/Runner.xcodeproj/project.pbxproj @@ -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; @@ -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; @@ -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; From caab7f9c3bbcca04a06542ae406fb85d3b4c7952 Mon Sep 17 00:00:00 2001 From: Vishveshwara Date: Tue, 16 Sep 2025 14:12:38 +0530 Subject: [PATCH 4/6] fixed uploading packages to app branch --- .github/actions/debian/action.yml | 43 ----------- .github/actions/linux/action.yml | 64 +++++++++++++++ .github/actions/macos/action.yml | 16 +++- .github/actions/web/action.yml | 28 ------- .github/workflows/pull_request.yml | 24 ++---- .github/workflows/push.yml | 120 ++++++++++++----------------- 6 files changed, 136 insertions(+), 159 deletions(-) delete mode 100644 .github/actions/debian/action.yml create mode 100644 .github/actions/linux/action.yml delete mode 100644 .github/actions/web/action.yml diff --git a/.github/actions/debian/action.yml b/.github/actions/debian/action.yml deleted file mode 100644 index a289434b..00000000 --- a/.github/actions/debian/action.yml +++ /dev/null @@ -1,43 +0,0 @@ -name: "Debian 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 Linux dependencies - shell: bash - run: | - sudo apt-get update - sudo apt-get install -y \ - libgtk-3-dev \ - liblzma-dev \ - clang \ - cmake \ - ninja-build \ - pkg-config \ - libglib2.0-dev \ - libblkid-dev \ - libgcrypt20-dev - - - name: Build Linux (Debian) App - shell: bash - env: - VERSION_NAME: ${{ inputs.VERSION_NAME }} - VERSION_CODE: ${{ inputs.VERSION_CODE }} - run: | - flutter build linux --build-name $VERSION_NAME --build-number $VERSION_CODE \ No newline at end of file diff --git a/.github/actions/linux/action.yml b/.github/actions/linux/action.yml new file mode 100644 index 00000000..03104cd4 --- /dev/null +++ b/.github/actions/linux/action.yml @@ -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 pslab \ + -v ${{ inputs.VERSION_NAME }} \ + --prefix=/ \ + -C build/linux/package \ + usr + - name: Build .rpm package + shell: bash + run: | + fpm -s dir -t rpm \ + -n pslab \ + -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" \ No newline at end of file diff --git a/.github/actions/macos/action.yml b/.github/actions/macos/action.yml index e8d2b0e8..c0b6d6dc 100644 --- a/.github/actions/macos/action.yml +++ b/.github/actions/macos/action.yml @@ -19,10 +19,24 @@ runs: 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 build macos --build-name $VERSION_NAME --build-number $VERSION_CODE \ No newline at end of file + 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 \ No newline at end of file diff --git a/.github/actions/web/action.yml b/.github/actions/web/action.yml deleted file mode 100644 index 008e7436..00000000 --- a/.github/actions/web/action.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: "Web 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 Web App - shell: bash - env: - VERSION_NAME: ${{ inputs.VERSION_NAME }} - VERSION_CODE: ${{ inputs.VERSION_CODE }} - run: | - flutter build web --release --build-name $VERSION_NAME --build-number $VERSION_CODE diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 0182c455..da807e8c 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -53,7 +53,7 @@ jobs: - name: Set up Xcode uses: maxim-lobanov/setup-xcode@v1.6.0 with: - xcode-version: latest-stable + xcode-version: '16.4.0' - uses: actions/checkout@v4 @@ -81,25 +81,15 @@ jobs: - name: Windows Workflow uses: ./.github/actions/windows - debian: - name: Debian Flutter Build + linux: + name: Linux Flutter Build needs: common runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Debian Workflow - uses: ./.github/actions/debian - - web: - name: Web Flutter Build - needs: common - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: Web Workflow - uses: ./.github/actions/web + - name: Linux Workflow + uses: ./.github/actions/linux screenshots-android: name: Screenshots (Android) @@ -122,7 +112,7 @@ jobs: - name: Set up Xcode uses: maxim-lobanov/setup-xcode@v1.6.0 with: - xcode-version: latest-stable + xcode-version: '16.4.0' - uses: actions/checkout@v4 @@ -139,7 +129,7 @@ jobs: - name: Set up Xcode uses: maxim-lobanov/setup-xcode@v1.6.0 with: - xcode-version: latest-stable + xcode-version: '16.4.0' - uses: actions/checkout@v4 diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index fb994e55..80cefa83 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -163,7 +163,7 @@ jobs: - name: Set up Xcode uses: maxim-lobanov/setup-xcode@v1.6.0 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/setup-xcode@v1.6.0 with: - xcode-version: latest-stable + xcode-version: '16.4.0' - uses: actions/checkout@v4 @@ -263,7 +263,7 @@ jobs: - name: Set up Xcode uses: maxim-lobanov/setup-xcode@v1.6.0 with: - xcode-version: latest-stable + xcode-version: '16.4.0' - uses: actions/checkout@v4 @@ -273,40 +273,48 @@ jobs: IPAD_DEVICE_MODEL: ${{ env.IPAD_DEVICE_MODEL }} - debian: - name: Debian Flutter Build + linux: + name: Linux Flutter Build needs: common runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Debian Workflow - uses: ./.github/actions/debian + - name: Linux Workflow + uses: ./.github/actions/linux with: - VERSION_NAME: ${{ needs.common.outputs.VERSION_NAME }} - VERSION_CODE: ${{ needs.common.outputs.VERSION_CODE }} - - - name: Upload Debian Build - uses: actions/upload-artifact@v4 - with: - name: Debian Build - path: build/linux/x64/release/bundle/ + VERSION_NAME: ${{needs.common.outputs.VERSION_NAME}} + VERSION_CODE: ${{needs.common.outputs.VERSION_CODE}} - - name: Push Debian Build to app branch - shell: bash + - 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 + + git clone --branch=app https://${{ github.repository_owner }}:${{ github.token }}@github.com/${{ github.repository }} apk cd app + branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}} - cp -r ../build/linux/x64/release/bundle/* . + + 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 -m "[Auto] Update Debian build from $branch ($(date +%Y-%m-%d.%H:%M:%S))" + 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 @@ -352,64 +360,36 @@ jobs: - name: Windows Workflow uses: ./.github/actions/windows with: - VERSION_NAME: ${{ needs.common.outputs.VERSION_NAME }} - VERSION_CODE: ${{ needs.common.outputs.VERSION_CODE }} - - - name: Upload Windows Build - uses: actions/upload-artifact@v4 - with: - name: Windows Build - path: build/windows/x64/runner/Release/ + VERSION_NAME: ${{needs.common.outputs.VERSION_NAME}} + VERSION_CODE: ${{needs.common.outputs.VERSION_CODE}} - - name: Push Windows Build to app branch + - 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 + + git clone --branch=app https://${{ github.repository_owner }}:${{ github.token }}@github.com/${{ github.repository }} apk cd app + branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}} - # Copy all Windows build artifacts to root - cp -r ../build/windows/x64/runner/Release/* . + + 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 -m "[Auto] Update Windows build from $branch ($(date +%Y-%m-%d.%H:%M:%S))" + 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 -web: - name: Web Flutter Build - needs: common - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: Web Workflow - uses: ./.github/actions/web - with: - VERSION_NAME: ${{ needs.common.outputs.VERSION_NAME }} - VERSION_CODE: ${{ needs.common.outputs.VERSION_CODE }} - - - name: Upload Web Build - uses: actions/upload-artifact@v4 - with: - name: Web Build - path: build/web - - - name: Push Web 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 Web build artifacts to root - cp -r ../build/web/* . - git checkout --orphan temporary - git add --all - git commit -m "[Auto] Update Web build from $branch ($(date +%Y-%m-%d.%H:%M:%S))" - git branch -D app - git branch -m app - git push --force origin app + From bc366d46ee5a3411d0fe4968927dfcdbef70c8f0 Mon Sep 17 00:00:00 2001 From: Vishveshwara Date: Tue, 16 Sep 2025 14:17:27 +0530 Subject: [PATCH 5/6] branch name fix --- .github/workflows/push.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 80cefa83..4eea3668 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -292,7 +292,7 @@ jobs: 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 }} apk + 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/}} @@ -370,7 +370,7 @@ jobs: 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 }} apk + 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/}} From 6f6e81f31d1d3e03d0321963d052b2f29240f34e Mon Sep 17 00:00:00 2001 From: Vishveshwara Date: Wed, 17 Sep 2025 18:14:30 +0530 Subject: [PATCH 6/6] Changed Linux directory name for packages --- .github/actions/linux/action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/linux/action.yml b/.github/actions/linux/action.yml index 03104cd4..df8a89a8 100644 --- a/.github/actions/linux/action.yml +++ b/.github/actions/linux/action.yml @@ -43,7 +43,7 @@ runs: 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 pslab \ + -n magicepaper \ -v ${{ inputs.VERSION_NAME }} \ --prefix=/ \ -C build/linux/package \ @@ -52,7 +52,7 @@ runs: shell: bash run: | fpm -s dir -t rpm \ - -n pslab \ + -n magicepaper \ -v ${{ inputs.VERSION_NAME }} \ --prefix=/ \ -C build/linux/package \