diff --git a/.github/workflows/generate.yml b/.github/workflows/generate.yml index 833c939..b05920b 100644 --- a/.github/workflows/generate.yml +++ b/.github/workflows/generate.yml @@ -1,68 +1,157 @@ -name: "publish" - +name: Publish Release on: push: - branches: - - main + tags: + - "v*" + branches: "*" + workflow_dispatch: -# This is the example from the readme. -# On each push to the `release` branch it will create or update a GitHub release, build your app, and upload the artifacts to the release. +env: + APP_NAME: "Dester Desktop App" jobs: - publish-tauri: - permissions: - contents: write + changelog: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Build changelog + id: build_changelog + run: | + # NOTE: if commits subjects are standardized, you can filter the git log based on feat: and fix: + # and then replace "feat:" with "New: " and "fix:" with "Fixed " + # when AI gets good, we can also summarized commits into a bullet point list + PREV_TAG=$(git tag --list v* | tail -n2 | head -n1) + echo "changelog=$(git log $PREV_TAG...${{ github.ref_name }} --pretty=format:"- %s")" >> $GITHUB_OUTPUT + outputs: + changelog: ${{ steps.build_changelog.outputs.changelog }} + build-arm: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Setup ARM build environment + run: | + rustup target add aarch64-unknown-linux-gnu + sudo apt install gcc-aarch64-linux-gnu + sudo dpkg --add-architecture arm64 + . /etc/os-release + echo "using Ubuntu with codename $VERSION_CODENAME" + echo "deb [arch=armhf,arm64] http://ports.ubuntu.com/ubuntu-ports $VERSION_CODENAME main restricted" | sudo tee -a /etc/apt/sources.list + echo "deb [arch=armhf,arm64] http://ports.ubuntu.com/ubuntu-ports $VERSION_CODENAME-updates main restricted" | sudo tee -a /etc/apt/sources.list + echo "deb [arch=armhf,arm64] http://ports.ubuntu.com/ubuntu-ports $VERSION_CODENAME universe" | sudo tee -a /etc/apt/sources.list + echo "deb [arch=armhf,arm64] http://ports.ubuntu.com/ubuntu-ports $VERSION_CODENAME-updates universe" | sudo tee -a /etc/apt/sources.list + echo "deb [arch=armhf,arm64] http://ports.ubuntu.com/ubuntu-ports $VERSION_CODENAME multiverse" | sudo tee -a /etc/apt/sources.list + echo "deb [arch=armhf,arm64] http://ports.ubuntu.com/ubuntu-ports $VERSION_CODENAME-updates multiverse" | sudo tee -a /etc/apt/sources.list + echo "deb [arch=armhf,arm64] http://ports.ubuntu.com/ubuntu-ports $VERSION_CODENAME-backports main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list + echo "deb [arch=armhf,arm64] http://ports.ubuntu.com/ubuntu-ports $VERSION_CODENAME-security main restricted" | sudo tee -a /etc/apt/sources.list + echo "deb [arch=armhf,arm64] http://ports.ubuntu.com/ubuntu-ports $VERSION_CODENAME-security universe" | sudo tee -a /etc/apt/sources.list + echo "deb [arch=armhf,arm64] http://ports.ubuntu.com/ubuntu-ports $VERSION_CODENAME-security multiverse" | sudo tee -a /etc/apt/sources.list + sudo apt update + sudo apt upgrade -y + sudo apt install libwebkit2gtk-4.0-dev:arm64 -y + sudo apt install libssl-dev:arm64 -y + export PKG_CONFIG_SYSROOT_DIR=/usr/aarch64-linux-gnu/ + pnpm install + pnpm rls --target aarch64-unknown-linux-gnu + - name: Upload deb bundle + uses: actions/upload-artifact@v4 + with: + name: ARM Debian File + path: src-tauri/target/release/bundle/deb/*arm64.deb + release: strategy: fail-fast: false matrix: - include: - - platform: "macos-latest" # for Arm based macs (M1 and above). - args: "--target aarch64-apple-darwin" - - platform: "macos-latest" # for Intel based macs. - args: "--target x86_64-apple-darwin" - - platform: "ubuntu-22.04" # for Tauri v1 you could replace this with ubuntu-20.04. - args: "" - - platform: "windows-latest" - args: "" - + platform: [macos-latest, ubuntu-latest, windows-latest] runs-on: ${{ matrix.platform }} + needs: [changelog] steps: - - uses: actions/checkout@v4 + - name: Checkout repository + uses: actions/checkout@v4 - - name: Setup pnpm - uses: pnpm/action-setup@v3 + # build the changelog based on the commit messages between the versioned tags + - name: Install pnpm + uses: pnpm/action-setup@v4 with: - version: 8 + version: 9 - - name: setup node + - name: Setup Node.js uses: actions/setup-node@v4 + # NOTE: enterprise developers may hard code a version with: - node-version: lts/* + node-version: "lts/*" + cache: pnpm + # node-version-file: '.nvmrc' + + - name: Setup Rust + run: | + rustup update --no-self-update - - name: install Rust stable - uses: dtolnay/rust-toolchain@stable + - name: Rust cache + uses: swatinem/rust-cache@v2 with: - # Those targets are only used on macos runners so it's in an `if` to slightly speed up windows and linux builds. - targets: ${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }} + workspaces: "./src-tauri -> target" - - name: install dependencies (ubuntu only) - if: matrix.platform == 'ubuntu-22.04' # This must match the platform value defined above. + - name: Install Ubuntu dependencies + if: matrix.platform == 'ubuntu-latest' run: | - sudo apt-get update - sudo apt-get install -y libwebkit2gtk-4.0-dev libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf - # webkitgtk 4.0 is for Tauri v1 - webkitgtk 4.1 is for Tauri v2. - # You can remove the one that doesn't apply to your app to speed up the workflow a bit. + sudo apt update + xargs sudo apt install -y < environment/apt_packages.txt - - name: install frontend dependencies - run: pnpm install # change this to npm, pnpm or bun depending on which one you use. + - name: Install frontend + run: | + pnpm install + + - name: CI Build + if: ${{ github.ref_type == 'branch' }} + run: | + pnpm rls + + - name: CI Upload Windows + if: ${{ github.ref_type == 'branch' && matrix.platform == 'windows-latest' }} + uses: actions/upload-artifact@v4 + with: + name: "Windows Installers" + path: | + src-tauri/release/bundle/msi/*.msi + src-tauri/release/bundle/nsis/*.exe + + - name: CI Upload macOS + if: ${{ github.ref_type == 'branch' && matrix.platform == 'macos-latest' }} + uses: actions/upload-artifact@v4 + with: + name: "macOS Installer" + path: | + src-tauri/release/bundle/dmg/*.dmg + + - name: CI Upload Linux + if: ${{ github.ref_type == 'branch' && matrix.platform == 'ubuntu-latest' }} + uses: actions/upload-artifact@v4 + with: + name: "Linux Distributions" + path: | + src-tauri/target/release/bundle/deb/*.deb + src-tauri/target/release/bundle/AppImage/*.AppImage - - uses: tauri-apps/tauri-action@v0 + # TODO: https://tauri.app/v1/guides/building/linux#cross-compiling-tauri-applications-for-arm-based-devices + - name: Build Tauri app + uses: tauri-apps/tauri-action@v0 + if: ${{ github.ref_type == 'tag' }} + # if u get Error: Resource not accessible by integration + # go to repository Settings => Action => General => Workflow permissions => Switch to Read and Write permisions env: + CI: true GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }} + TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }} with: - tagName: app-v__VERSION__ # the action automatically replaces \_\_VERSION\_\_ with the app version. - releaseName: "App v__VERSION__" - releaseBody: "See the assets to download this version and install." + # tauri-action replaces \_\_VERSION\_\_ with the app version + tagName: ${{ github.ref_name }} + releaseName: "${{ env.APP_NAME }} v__VERSION__" + releaseBody: | + ${{needs.changelog.outputs.changelog}} + See the assets to download this version and install. releaseDraft: true prerelease: false - args: ${{ matrix.args }} diff --git a/app/(dester)/layout.tsx b/app/(dester)/layout.tsx new file mode 100644 index 0000000..7dfabe0 --- /dev/null +++ b/app/(dester)/layout.tsx @@ -0,0 +1,31 @@ +import type { Metadata } from "next"; +import "../globals.css"; +import Navbar from "@/lib/components/Navbar"; +import Sidebar from "@/lib/components/Sidebar"; +import Background from "@/lib/components/Background"; + +export const metadata: Metadata = { + title: "Dester Desktop App", + description: "An intuvitive way to see all your content library at one place", +}; + +export default function AppLayout({ + children, +}: Readonly<{ + children: React.ReactNode; +}>) { + return ( +
+ +
+ +
+ +
+ {children} +
+
+
+
+ ); +} diff --git a/app/(dester)/loading.tsx b/app/(dester)/loading.tsx new file mode 100644 index 0000000..80778b2 --- /dev/null +++ b/app/(dester)/loading.tsx @@ -0,0 +1,7 @@ +import React from "react"; + +const Loading = () => { + return
Loading
; +}; + +export default Loading; diff --git a/app/page.tsx b/app/(dester)/page.tsx similarity index 94% rename from app/page.tsx rename to app/(dester)/page.tsx index 944b641..15dfe6a 100644 --- a/app/page.tsx +++ b/app/(dester)/page.tsx @@ -1,7 +1,6 @@ import { MainSlider } from "@/lib/components/MainSlider/MainSlider"; import database from "@/db/db"; import Slider from "@/lib/components/Slider"; -import Head from "next/head"; export default function Home() { return ( diff --git a/app/layout.tsx b/app/layout.tsx index 2f5c1a3..cda9ffc 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -1,17 +1,8 @@ -import type { Metadata } from "next"; import { Inter } from "next/font/google"; import "./globals.css"; -import Navbar from "@/lib/components/Navbar"; -import Sidebar from "@/lib/components/Sidebar"; -import Background from "@/lib/components/Background"; const inter = Inter({ subsets: ["latin"] }); -export const metadata: Metadata = { - title: "Dester Desktop App", - description: "An intuvitive way to see all your content library at one place", -}; - export default function RootLayout({ children, }: Readonly<{ @@ -20,18 +11,7 @@ export default function RootLayout({ return ( -
- -
- -
- -
- {children} -
-
-
-
+ {children} ); diff --git a/package.json b/package.json index deab56a..5608425 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ "dependencies": { "@react-spring/web": "^9.7.3", "@splidejs/react-splide": "^0.7.12", + "@tauri-apps/api": "^1.5.6", "class-variance-authority": "^0.7.0", "embla-carousel": "^8.0.4", "embla-carousel-autoplay": "^8.0.4", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a88e027..d652f19 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -11,6 +11,9 @@ dependencies: '@splidejs/react-splide': specifier: ^0.7.12 version: 0.7.12 + '@tauri-apps/api': + specifier: ^1.5.6 + version: 1.5.6 class-variance-authority: specifier: ^0.7.0 version: 0.7.0 @@ -1820,6 +1823,11 @@ packages: tslib: 2.6.2 dev: false + /@tauri-apps/api@1.5.6: + resolution: {integrity: sha512-LH5ToovAHnDVe5Qa9f/+jW28I6DeMhos8bNDtBOmmnaDpPmJmYLyHdeDblAWWWYc7KKRDg9/66vMuKyq0WIeFA==} + engines: {node: '>= 14.6.0', npm: '>= 6.6.0', yarn: '>= 1.19.1'} + dev: false + /@tauri-apps/cli-darwin-arm64@1.5.13: resolution: {integrity: sha512-wXsBp6FIsQ1yoAEJ8dao7BkVdOp5xlfgGyAbJVCFKU3LTUqKw4A+ayxO6CV2lFfSaOdzdU86z+eJsl38nzmoSg==} engines: {node: '>= 10'} diff --git a/src-tauri/icons/128x128.png b/src-tauri/icons/128x128.png index 77e7d23..7248f46 100644 Binary files a/src-tauri/icons/128x128.png and b/src-tauri/icons/128x128.png differ diff --git a/src-tauri/icons/128x128@2x.png b/src-tauri/icons/128x128@2x.png index 0f7976f..94e9ee4 100644 Binary files a/src-tauri/icons/128x128@2x.png and b/src-tauri/icons/128x128@2x.png differ diff --git a/src-tauri/icons/32x32.png b/src-tauri/icons/32x32.png index 98fda06..88146e2 100644 Binary files a/src-tauri/icons/32x32.png and b/src-tauri/icons/32x32.png differ diff --git a/src-tauri/icons/Square107x107Logo.png b/src-tauri/icons/Square107x107Logo.png index f35d84f..b15d9e4 100644 Binary files a/src-tauri/icons/Square107x107Logo.png and b/src-tauri/icons/Square107x107Logo.png differ diff --git a/src-tauri/icons/Square142x142Logo.png b/src-tauri/icons/Square142x142Logo.png index 1823bb2..f2fae9e 100644 Binary files a/src-tauri/icons/Square142x142Logo.png and b/src-tauri/icons/Square142x142Logo.png differ diff --git a/src-tauri/icons/Square150x150Logo.png b/src-tauri/icons/Square150x150Logo.png index dc2b22c..dfe406a 100644 Binary files a/src-tauri/icons/Square150x150Logo.png and b/src-tauri/icons/Square150x150Logo.png differ diff --git a/src-tauri/icons/Square284x284Logo.png b/src-tauri/icons/Square284x284Logo.png index 0ed3984..ad9a459 100644 Binary files a/src-tauri/icons/Square284x284Logo.png and b/src-tauri/icons/Square284x284Logo.png differ diff --git a/src-tauri/icons/Square30x30Logo.png b/src-tauri/icons/Square30x30Logo.png index 60bf0ea..46c129f 100644 Binary files a/src-tauri/icons/Square30x30Logo.png and b/src-tauri/icons/Square30x30Logo.png differ diff --git a/src-tauri/icons/Square310x310Logo.png b/src-tauri/icons/Square310x310Logo.png index c8ca0ad..10da000 100644 Binary files a/src-tauri/icons/Square310x310Logo.png and b/src-tauri/icons/Square310x310Logo.png differ diff --git a/src-tauri/icons/Square44x44Logo.png b/src-tauri/icons/Square44x44Logo.png index 8756459..873b271 100644 Binary files a/src-tauri/icons/Square44x44Logo.png and b/src-tauri/icons/Square44x44Logo.png differ diff --git a/src-tauri/icons/Square71x71Logo.png b/src-tauri/icons/Square71x71Logo.png index 2c8023c..dbcb931 100644 Binary files a/src-tauri/icons/Square71x71Logo.png and b/src-tauri/icons/Square71x71Logo.png differ diff --git a/src-tauri/icons/Square89x89Logo.png b/src-tauri/icons/Square89x89Logo.png index 2c5e603..8a74f8a 100644 Binary files a/src-tauri/icons/Square89x89Logo.png and b/src-tauri/icons/Square89x89Logo.png differ diff --git a/src-tauri/icons/StoreLogo.png b/src-tauri/icons/StoreLogo.png index 17d142c..2e5ea76 100644 Binary files a/src-tauri/icons/StoreLogo.png and b/src-tauri/icons/StoreLogo.png differ diff --git a/src-tauri/icons/icon.icns b/src-tauri/icons/icon.icns index a2993ad..73f91a9 100644 Binary files a/src-tauri/icons/icon.icns and b/src-tauri/icons/icon.icns differ diff --git a/src-tauri/icons/icon.ico b/src-tauri/icons/icon.ico index 06c23c8..98cb764 100644 Binary files a/src-tauri/icons/icon.ico and b/src-tauri/icons/icon.ico differ diff --git a/src-tauri/icons/icon.png b/src-tauri/icons/icon.png index d1756ce..71957db 100644 Binary files a/src-tauri/icons/icon.png and b/src-tauri/icons/icon.png differ diff --git a/tailwind.config.ts b/tailwind.config.ts index 06c0ac8..433bee2 100644 --- a/tailwind.config.ts +++ b/tailwind.config.ts @@ -5,6 +5,7 @@ const config: Config = { "./pages/**/*.{js,ts,jsx,tsx,mdx}", "./lib/components/**/*.{js,ts,jsx,tsx,mdx}", "./app/**/*.{js,ts,jsx,tsx,mdx}", + "./public/splashscreen.html", ], theme: { extend: {