Skip to content

Commit

Permalink
Merge pull request #1 from fluentci-io/feat/electron
Browse files Browse the repository at this point in the history
feat: add desktop version for MacOS and Linux
  • Loading branch information
tsirysndr authored May 27, 2024
2 parents 80be0b9 + 645871c commit 78c7316
Show file tree
Hide file tree
Showing 31 changed files with 1,139 additions and 128 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/release-app-for-mac-arm64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: release desktop app for mac arm64
on:
release:
types: [created]

jobs:
build:
runs-on: macos-14
steps:
- uses: actions/checkout@v2
- name: Setup Fluent CI and build webui
uses: fluentci-io/setup-fluentci@v5
with:
wasm: true
pipeline: bun
args: |
run build
working-directory: webui
env:
GITHUB_ACCESS_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }}
- name: List files
run: ls -ltr release/*
working-directory: webui
- name: Upload assets to Cloudflare R2
run: |
mkdir -p r2/fluentci-studio/${{ env.RELEASE_VERSION }}
cp fluentci-studio_*_arm64.dmg r2/fluentci-studio/${{ env.RELEASE_VERSION }}
cp fluentci-studio_*_arm64.zip r2/fluentci-studio/${{ env.RELEASE_VERSION }}
cd r2 && fluentci run --wasm r2-sync upload --endpoint-url https://$ACCOUNT_ID.r2.cloudflarestorage.com s3://assets
env:
TAG: ${{ env.RELEASE_VERSION }}
GITHUB_ACCESS_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
ACCOUNT_ID: fe5b1e2ce9f94f4c0415ab94ce402012
- name: Upload release assets
run: |
for ext in dmg zip; do
export FILE=fluentci-studio_*_arm64.$ext
fluentci run --wasm github release_upload $TAG $FILE
done
env:
TAG: ${{ env.RELEASE_VERSION }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_ACCESS_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }}
45 changes: 45 additions & 0 deletions .github/workflows/release-app-for-mac-x86_64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: release desktop app for mac x86_64
on:
release:
types: [created]

jobs:
build:
runs-on: macos-12
steps:
- uses: actions/checkout@v2
- name: Setup Fluent CI and build webui
uses: fluentci-io/setup-fluentci@v5
with:
wasm: true
pipeline: bun
args: |
run build
working-directory: webui
env:
GITHUB_ACCESS_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }}
- name: List files
run: ls -ltr release/*
working-directory: webui
- name: Upload assets to Cloudflare R2
run: |
mkdir -p r2/fluentci-studio/${{ env.RELEASE_VERSION }}
cp fluentci-studio_*_x64.dmg r2/fluentci-studio/${{ env.RELEASE_VERSION }}
cp fluentci-studio_*_x64.zip r2/fluentci-studio/${{ env.RELEASE_VERSION }}
cd r2 && fluentci run --wasm r2-sync upload --endpoint-url https://$ACCOUNT_ID.r2.cloudflarestorage.com s3://assets
env:
TAG: ${{ env.RELEASE_VERSION }}
GITHUB_ACCESS_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
ACCOUNT_ID: fe5b1e2ce9f94f4c0415ab94ce402012
- name: Upload release assets
run: |
for ext in dmg zip; do
export FILE=fluentci-studio_*_x64.$ext
fluentci run --wasm github release_upload $TAG $FILE
done
env:
TAG: ${{ env.RELEASE_VERSION }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_ACCESS_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }}
45 changes: 45 additions & 0 deletions .github/workflows/release-app.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: release desktop app for linux
on:
release:
types: [created]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Fluent CI and build webui
uses: fluentci-io/setup-fluentci@v5
with:
wasm: true
pipeline: bun
args: |
run build
working-directory: webui
env:
GITHUB_ACCESS_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }}
- name: List files
run: ls -ltr release/*
working-directory: webui
- name: Upload assets to Cloudflare R2
run: |
mkdir -p r2/fluentci-studio/${{ env.RELEASE_VERSION }}
cp fluentci-studio-*.AppImage r2/fluentci-studio/${{ env.RELEASE_VERSION }}
cp fluentci-studio-*.tar.gz r2/fluentci-studio/${{ env.RELEASE_VERSION }}
cd r2 && fluentci run --wasm r2-sync upload --endpoint-url https://$ACCOUNT_ID.r2.cloudflarestorage.com s3://assets
env:
TAG: ${{ env.RELEASE_VERSION }}
GITHUB_ACCESS_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
ACCOUNT_ID: fe5b1e2ce9f94f4c0415ab94ce402012
- name: Upload release assets
run: |
for ext in tar.gz AppImage; do
export FILE=fluentci-studio-*.$ext
fluentci run --wasm github release_upload $TAG $FILE
done
env:
TAG: ${{ env.RELEASE_VERSION }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_ACCESS_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }}
2 changes: 2 additions & 0 deletions webui/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ lerna-debug.log*
node_modules
dist
dist-ssr
dist-electron
release/
*.local

# Editor directories and files
Expand Down
Binary file added webui/assets/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified webui/bun.lockb
Binary file not shown.
31 changes: 31 additions & 0 deletions webui/electron-builder.json5
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/**
* @see https://www.electron.build/configuration/configuration
*/
{
appId: "io.fluentci.app",
asar: true,
directories: {
output: "release/${version}",
},
files: ["dist-electron", "dist"],
mac: {
icon: "assets/icon.png",
artifactName: "${productName}_${version}_${arch}.${ext}",
target: ["dmg", "zip"],
},
linux: {
icon: "assets/icon.png",
target: ["AppImage", "tar.gz"],
},
nsis: {
oneClick: false,
perMachine: false,
allowToChangeInstallationDirectory: true,
deleteAppDataOnUninstall: false,
},
publish: {
provider: "generic",
channel: "latest",
url: "https://github.com/fluentci-io/fluentci-studio/releases/download/v0.1.0/",
},
}
23 changes: 23 additions & 0 deletions webui/electron/electron-env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/// <reference types="vite-electron-plugin/electron-env" />

declare namespace NodeJS {
interface ProcessEnv {
VSCODE_DEBUG?: 'true'
/**
* The built directory structure
*
* ```tree
* β”œβ”€β”¬ dist-electron
* β”‚ β”œβ”€β”¬ main
* β”‚ β”‚ └── index.js > Electron-Main
* β”‚ └─┬ preload
* β”‚ └── index.mjs > Preload-Scripts
* β”œβ”€β”¬ dist
* β”‚ └── index.html > Electron-Renderer
* ```
*/
APP_ROOT: string
/** /dist/ or /public/ */
VITE_PUBLIC: string
}
}
Loading

0 comments on commit 78c7316

Please sign in to comment.