From 718ebe25fbafe8cfefc406982d2a6cbc46180202 Mon Sep 17 00:00:00 2001 From: Jan Willem Eriks Date: Wed, 28 Sep 2022 19:40:11 +0200 Subject: [PATCH 01/11] Added flatpak manifest and .destkop Currently the zip archive url in the manifest is temporary for demonstration purposes. --- .gitignore | 9 +++ flatpak/com.github.upscayl.upscayl.json | 72 +++++++++++++++++++ .../com.github.upscayl.upscayl.metainfo.xml | 25 +++++++ 3 files changed, 106 insertions(+) create mode 100644 flatpak/com.github.upscayl.upscayl.json create mode 100644 flatpak/com.github.upscayl.upscayl.metainfo.xml diff --git a/.gitignore b/.gitignore index 6165d4a..69cf607 100644 --- a/.gitignore +++ b/.gitignore @@ -32,3 +32,12 @@ yarn-error.log* # vercel .vercel + +#flatpak +.flatpak/ +.flatpak-builder +repo/ +build-dir/ + +#vscode +.vscode/ \ No newline at end of file diff --git a/flatpak/com.github.upscayl.upscayl.json b/flatpak/com.github.upscayl.upscayl.json new file mode 100644 index 0000000..c7e5a10 --- /dev/null +++ b/flatpak/com.github.upscayl.upscayl.json @@ -0,0 +1,72 @@ +{ + "app-id": "com.github.upscayl.upscayl", + "runtime": "org.freedesktop.Platform", + "runtime-version": "22.08", + "sdk": "org.freedesktop.Sdk", + "base": "org.electronjs.Electron2.BaseApp", + "base-version": "22.08", + "command": "upscayl-wrapper", + "separate-locales": false, + "finish-args": [ + "--share=ipc", + "--socket=x11", + "--device=dri", + "--filesystem=home" + ], + "modules": [ + { + "name": "zypak", + "sources": [ + { + "type": "git", + "url": "https://github.com/refi64/zypak", + "tag": "v2022.04" + } + ] + }, + { + "name": "upscayl", + "buildsystem": "simple", + "cleanup": [ + "upscayl-1.5.5.zip" + ], + "sources": [ + { + "type": "file", + "only-arches": [ + "x86_64" + ], + "url": "https://github.com/JanDeDinoMan/upscayl/releases/download/v1.5.5/upscayl-1.5.5.zip", + "sha256": "0e57b3cbb96299fac6beea185ffdf2f105d3258ac6081bd1f3c408912541dacc" + }, + { + "type": "file", + "path": "com.github.upscayl.upscayl.metainfo.xml" + }, + { + "type": "file", + "path": "../main/build/icon.png" + }, + { + "type": "script", + "dest-filename": "upscayl-wrapper", + "commands": [ + "zypak-wrapper /app/upscayl/upscayl" + ] + } + ], + "build-commands": [ + "install -d /app/upscayl", + "unzip upscayl-1.5.5 -d /app/upscayl", + "install upscayl-wrapper /app/bin/", + "install -d /app/share/icons/hicolor/512x512/apps/", + "install icon.png /app/share/icons/hicolor/512x512/apps/com.github.upscayl.upscayl.png", + "install -d /app/share/applications", + "touch com.github.upscayl.upscayl.desktop", + "install -Dp -m644 com.github.upscayl.upscayl.metainfo.xml /app/share/metainfo/com.github.upscayl.upscayl.metainfo.xml", + "install -m644 com.github.upscayl.upscayl.desktop /app/share/applications/com.github.upscayl.upscayl.desktop", + "desktop-file-edit --set-key=Exec --set-value='upscayl-wrapper %U' --set-key=Icon --set-value='com.github.upscayl.upscayl' --set-key=Comment --set-value='Upscale Images' --set-key=Name --set-value='Upscayl' --set-key=StartupNotify --set-value='false' --set-key=Categories --set-value='ImageProcessing;RasterGraphics;Graphics;' --set-key=Type --set-value='Application' /app/share/applications/com.github.upscayl.upscayl.desktop" + ] + } + ] +} \ No newline at end of file diff --git a/flatpak/com.github.upscayl.upscayl.metainfo.xml b/flatpak/com.github.upscayl.upscayl.metainfo.xml new file mode 100644 index 0000000..9532f85 --- /dev/null +++ b/flatpak/com.github.upscayl.upscayl.metainfo.xml @@ -0,0 +1,25 @@ + + + com.github.upscayl.upscayl + Upscayl + Free and Open Source AI Image Upscaler + Nayam Amarshe + com.github.upscayl.upscayl.desktop + FSFAP + AGPL-3.0 + +

Free and Open Source AI Image Upscaler

+
+ https://github.com/upscayl/upscayl/ + https://github.com/upscayl/upscayl/issues + + Graphics + RasterGraphics + ImageProcessing + + + + upscale + + Upscayl +
\ No newline at end of file From c8552da2963d11ecfaadf876c83d7990bee82717 Mon Sep 17 00:00:00 2001 From: Jan Willem Eriks Date: Wed, 28 Sep 2022 21:06:51 +0200 Subject: [PATCH 02/11] Set the zoom factor to 1 The flatpak build can have a quirk where the zoom level is really low. So we force it to be 1. --- main/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/main/index.js b/main/index.js index f3b6ffd..ef24271 100644 --- a/main/index.js +++ b/main/index.js @@ -66,6 +66,7 @@ app.on("ready", async () => { mainWindow.once("ready-to-show", () => { mainWindow.show(); + mainWindow.webContents.setZoomFactor(1) }); if (!isDev) { From 5843df5715068496b505c66bb97c9add56c93740 Mon Sep 17 00:00:00 2001 From: Jan Willem Eriks Date: Wed, 28 Sep 2022 21:09:46 +0200 Subject: [PATCH 03/11] Fix nextjs image unoptimized Bump the Next.js version so that build pass again after cloning. In Next.js 12.3 the unoptimzed configuration became stable. Ref: https://nextjs.org/blog/next-12-3#disable-image-optimization-stable --- next.config.js | 8 +++----- package.json | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/next.config.js b/next.config.js index 63618cd..a75d922 100644 --- a/next.config.js +++ b/next.config.js @@ -1,7 +1,5 @@ module.exports = { - experimental: { - images: { - unoptimized: true - } + images: { + unoptimized: true } -} \ No newline at end of file +} diff --git a/package.json b/package.json index c6fcff3..31285e4 100644 --- a/package.json +++ b/package.json @@ -124,7 +124,7 @@ "autoprefixer": "^10.4.8", "electron": "^20.0.2", "electron-builder": "^23.3.3", - "next": "^12.2.5", + "next": "^12.3.1", "postcss": "^8.4.16", "prettier": "^2.7.1", "prettier-plugin-tailwindcss": "^0.1.13", From a2eead202c4f0c1eb363d8ce8429b0f8cd6a3777 Mon Sep 17 00:00:00 2001 From: Jan Willem Eriks Date: Wed, 28 Sep 2022 21:15:20 +0200 Subject: [PATCH 04/11] Add new zip for publishing --- package.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 31285e4..0381c2d 100644 --- a/package.json +++ b/package.json @@ -38,6 +38,7 @@ "dist": "npm run build && DEBUG=* electron-builder", "dist:appimage": "npm run build && DEBUG=* electron-builder build -l AppImage", "dist:flatpak": "npm run build && DEBUG=* electron-builder build -l flatpak", + "dist:zip": "npm run build && DEBUG=* electron-builder build -l zip", "dist:dmg": "npm run build && DEBUG=* electron-builder build -m dmg", "dist:msi": "npm run build && DEBUG=* electron-builder build -w nsis", "dist:pkg": "npm run build && DEBUG=* electron-builder build -m pkg", @@ -101,7 +102,8 @@ ], "target": [ "AppImage", - "flatpak" + "flatpak", + "zip" ], "category": "Graphics;2DGraphics;RasterGraphics;ImageProcessing;", "icon": "main/build/icon.png" From b64c51808f9fba45f6614cd901976161e39384d2 Mon Sep 17 00:00:00 2001 From: NayamAmarshe <25067102+NayamAmarshe@users.noreply.github.com> Date: Thu, 29 Sep 2022 21:09:09 +0530 Subject: [PATCH 05/11] Create main.yml --- .github/workflows/main.yml | 48 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..1ce0f6a --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,48 @@ +# name of your github action +name: CI +# this will help you specify where to run +on: + workflow_dispatch: +# this is where the magic happens, each job happens in parallel btw +jobs: + linux: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + with: + ref: electron + - uses: actions/setup-node@master + with: + node-version: 16 + - name: Install Modules and Publish build + run: | + npm install + npm run publish-linux-app + + macos: + runs-on: macOS-latest + steps: + - uses: actions/checkout@master + with: + ref: electron + - uses: actions/setup-node@master + with: + node-version: 16 + - name: Install Modules and Publish build + run: | + npm install + npm run publish-mac-app + + windo: + runs-on: windows-latest + steps: + - uses: actions/checkout@master + with: + ref: electron + - uses: actions/setup-node@master + with: + node-version: 16 + - name: Install Modules and Publish build + run: | + npm install + npm run publish-win-app From 2849844edada970881f6ebbb5bc9fa6b53d04377 Mon Sep 17 00:00:00 2001 From: NayamAmarshe <25067102+NayamAmarshe@users.noreply.github.com> Date: Thu, 29 Sep 2022 21:12:45 +0530 Subject: [PATCH 06/11] Update main.yml --- .github/workflows/main.yml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1ce0f6a..e3cc204 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -8,12 +8,12 @@ jobs: linux: runs-on: ubuntu-latest steps: - - uses: actions/checkout@master - with: - ref: electron - - uses: actions/setup-node@master + - uses: actions/checkout@v3 + + - uses: actions/setup-node@v3.5.0 with: node-version: 16 + - name: Install Modules and Publish build run: | npm install @@ -22,12 +22,12 @@ jobs: macos: runs-on: macOS-latest steps: - - uses: actions/checkout@master - with: - ref: electron - - uses: actions/setup-node@master + - uses: actions/checkout@v3 + + - uses: actions/setup-node@v3.5.0 with: node-version: 16 + - name: Install Modules and Publish build run: | npm install @@ -36,12 +36,12 @@ jobs: windo: runs-on: windows-latest steps: - - uses: actions/checkout@master - with: - ref: electron - - uses: actions/setup-node@master + - uses: actions/checkout@v3 + + - uses: actions/setup-node@v3.5.0 with: node-version: 16 + - name: Install Modules and Publish build run: | npm install From 07dbb31b00a8e9cda85cb339535aa190220a51ae Mon Sep 17 00:00:00 2001 From: NayamAmarshe <25067102+NayamAmarshe@users.noreply.github.com> Date: Thu, 29 Sep 2022 21:16:37 +0530 Subject: [PATCH 07/11] Update main.yml --- .github/workflows/main.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e3cc204..41db8c0 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -16,6 +16,11 @@ jobs: - name: Install Modules and Publish build run: | + sudo apt-get install flatpak -y + sudo apt-get install flatpak-builder -y + sudo apt-get install elfutils -y + sudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo + sudo flatpak install flathub org.freedesktop.Platform/x86_64/20.08 org.freedesktop.Sdk/x86_64/20.08 org.electronjs.Electron2.BaseApp/x86_64/stable -y npm install npm run publish-linux-app From a72c03c39ff6704979541e268f60d6b47af6f25d Mon Sep 17 00:00:00 2001 From: NayamAmarshe <25067102+NayamAmarshe@users.noreply.github.com> Date: Thu, 29 Sep 2022 21:18:39 +0530 Subject: [PATCH 08/11] Update main.yml --- .github/workflows/main.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 41db8c0..faa16e3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -22,7 +22,7 @@ jobs: sudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo sudo flatpak install flathub org.freedesktop.Platform/x86_64/20.08 org.freedesktop.Sdk/x86_64/20.08 org.electronjs.Electron2.BaseApp/x86_64/stable -y npm install - npm run publish-linux-app + GH_TOKEN=${{ secrets.GH_TOKEN }} && npm run publish-linux-app macos: runs-on: macOS-latest @@ -36,7 +36,7 @@ jobs: - name: Install Modules and Publish build run: | npm install - npm run publish-mac-app + GH_TOKEN=${{ secrets.GH_TOKEN }} && npm run publish-mac-app windo: runs-on: windows-latest @@ -50,4 +50,4 @@ jobs: - name: Install Modules and Publish build run: | npm install - npm run publish-win-app + GH_TOKEN=${{ secrets.GH_TOKEN }} && npm run publish-win-app From 5aff9cf3a2ffa15f100ca54cc0eabc2ea15b6b17 Mon Sep 17 00:00:00 2001 From: NayamAmarshe <25067102+NayamAmarshe@users.noreply.github.com> Date: Fri, 30 Sep 2022 11:26:42 +0530 Subject: [PATCH 09/11] Update package.json --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 0381c2d..1a86581 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,7 @@ "dist:msi": "npm run build && DEBUG=* electron-builder build -w nsis", "dist:pkg": "npm run build && DEBUG=* electron-builder build -m pkg", "publish-app": "npm run build && electron-builder -wl --publish always", - "publish-linux-app": "npm run build && electron-builder -l --publish always", + "publish-linux-app": "DEBUG=* npm run build && electron-builder -l --publish always", "publish-win-app": "npm run build && electron-builder -w --publish always", "publish-mac-app": "npm run build && electron-builder -m --publish always" }, From 50b39e862530af236b932aa58c5c7f9854f1abf8 Mon Sep 17 00:00:00 2001 From: Jan Willem Eriks Date: Fri, 30 Sep 2022 12:30:23 +0200 Subject: [PATCH 10/11] Fix CI/CD --- .github/workflows/main.yml | 14 ++++++++------ package.json | 2 +- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index faa16e3..c414d8d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -19,10 +19,10 @@ jobs: sudo apt-get install flatpak -y sudo apt-get install flatpak-builder -y sudo apt-get install elfutils -y - sudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo - sudo flatpak install flathub org.freedesktop.Platform/x86_64/20.08 org.freedesktop.Sdk/x86_64/20.08 org.electronjs.Electron2.BaseApp/x86_64/stable -y + flatpak remote-add --user --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo + flatpak install flathub org.freedesktop.Platform/x86_64/20.08 org.freedesktop.Sdk/x86_64/20.08 org.electronjs.Electron2.BaseApp/x86_64/stable -y npm install - GH_TOKEN=${{ secrets.GH_TOKEN }} && npm run publish-linux-app + GH_TOKEN=${{ secrets.GITHUB_TOKEN }} npm run publish-linux-app macos: runs-on: macOS-latest @@ -36,9 +36,9 @@ jobs: - name: Install Modules and Publish build run: | npm install - GH_TOKEN=${{ secrets.GH_TOKEN }} && npm run publish-mac-app + GH_TOKEN=${{ secrets.GITHUB_TOKEN }} npm run publish-mac-app - windo: + windows: runs-on: windows-latest steps: - uses: actions/checkout@v3 @@ -48,6 +48,8 @@ jobs: node-version: 16 - name: Install Modules and Publish build + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | npm install - GH_TOKEN=${{ secrets.GH_TOKEN }} && npm run publish-win-app + npm run publish-win-app diff --git a/package.json b/package.json index 1a86581..0381c2d 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,7 @@ "dist:msi": "npm run build && DEBUG=* electron-builder build -w nsis", "dist:pkg": "npm run build && DEBUG=* electron-builder build -m pkg", "publish-app": "npm run build && electron-builder -wl --publish always", - "publish-linux-app": "DEBUG=* npm run build && electron-builder -l --publish always", + "publish-linux-app": "npm run build && electron-builder -l --publish always", "publish-win-app": "npm run build && electron-builder -w --publish always", "publish-mac-app": "npm run build && electron-builder -m --publish always" }, From 0d63d52ed41a2683ce6c18050f2f0945d44f7c93 Mon Sep 17 00:00:00 2001 From: NayamAmarshe <25067102+NayamAmarshe@users.noreply.github.com> Date: Fri, 30 Sep 2022 21:16:36 +0530 Subject: [PATCH 11/11] Update main.yml --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c414d8d..daf50b0 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -22,7 +22,7 @@ jobs: flatpak remote-add --user --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo flatpak install flathub org.freedesktop.Platform/x86_64/20.08 org.freedesktop.Sdk/x86_64/20.08 org.electronjs.Electron2.BaseApp/x86_64/stable -y npm install - GH_TOKEN=${{ secrets.GITHUB_TOKEN }} npm run publish-linux-app + GH_TOKEN=${{ secrets.GH_TOKEN }} npm run publish-linux-app macos: runs-on: macOS-latest