Skip to content

Commit

Permalink
Workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
adi-panda committed Jul 26, 2023
1 parent c6cb9f6 commit fcbe5a9
Show file tree
Hide file tree
Showing 29 changed files with 483 additions and 358 deletions.
69 changes: 69 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: App Builder
on:
push:
tags:
- "v*"
workflow_dispatch:

jobs:
release:
strategy:
fail-fast: false
matrix:
platform: [macos-latest, ubuntu-latest, windows-latest]
include:
- os: ubuntu-latest
rust_target: x86_64-unknown-linux-gnu
- os: macos-latest
rust_target: x86_64-apple-darwin
- os: macos-latest
rust_target: aarch64-apple-darwin
- os: windows-latest
rust_target: x86_64-pc-windows-msvc
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout repository
uses: actions/checkout@v3

# for projects that use labels and PRs,
# try https://github.com/mikepenz/release-changelog-builder-action instead
# TODO: use API to collect commit messages
- name: Build Changelog
id: build_changelog
run: echo "changelog=- ADD CHANGELOG" >> $GITHUB_OUTPUT

- name: Node.js setup
uses: actions/setup-node@v3
# NOTE: enterprise developers may hard code a version
with:
node-version: latest
# node-version-file: '.nvmrc'

- name: Install Rust (Stable)
run: curl https://sh.rustup.rs -sSf | sh -s -- -y

- name: Install dependencies (ubuntu only)
if: matrix.platform == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf
- name: Install app dependencies from lockfile and build web
# NOTE: comment out && yarn build if frontend does not have build script
working-directory: ./kuebiko_v
run: yarn install --frozen-lockfile && yarn build

- name: Build the app
uses: tauri-apps/tauri-action@v0

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
# tauri-action replaces \_\_VERSION\_\_ with the app version
tagName: ${{ github.ref_name }}
releaseName: "Sample Release for Modern Desktop App v__VERSION__"
releaseBody: |
${{steps.build_changelog.outputs.changelog}}
See the assets to download this version and install.
releaseDraft: true
prerelease: false
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
node_modules
/build
/package
/*.json
/models
.env
__pycache__/
.env.*
Expand Down
6 changes: 6 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"[python]": {
"editor.defaultFormatter": "ms-python.black-formatter"
},
"python.formatting.provider": "none"
}
32 changes: 0 additions & 32 deletions chat.py

This file was deleted.

4 changes: 4 additions & 0 deletions kuebiko_v/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"tabWidth": 2,
"useTabs": false
}
3 changes: 2 additions & 1 deletion kuebiko_v/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"vite": "^4.3.5"
},
"dependencies": {
"@tauri-apps/api": "^1.3.0"
"@tauri-apps/api": "^1.3.0",
"fix-path-env-rs": "https://github.com/tauri-apps/fix-path-env-rs"
}
}
56 changes: 26 additions & 30 deletions kuebiko_v/src/App.svelte
Original file line number Diff line number Diff line change
@@ -1,40 +1,36 @@
<script lang="ts">
import Home from "./lib/Home.svelte";
import Prompt from "./lib/Prompt.svelte";
import Credentials from "./lib/Credentials.svelte";
import { state } from "./store";
import { initPrefs, saveState, getState } from "./prefs";
import { onMount } from "svelte";
<title>Kuebiko</title>
<script lang = "ts">
import Home from "./lib/Home.svelte";
import Prompt, {loadPrompt} from "./lib/Prompt.svelte";
import Credentials, {loadCredentials} from "./lib/Credentials.svelte";
let currentScreen = "home";
let appLoaded = false;
if(!appLoaded){
loadCredentials();
loadPrompt();
appLoaded = true;
}
onMount(() => {
initPrefs();
});
</script>
<div class = "menuButtons">
<button class = "menuButton" on:click={() => currentScreen = "home"}>

<title>Kuebiko</title>
<div class="menuButtons">
<button class="menuButton" on:click={() => ($state.CURRENT_PAGE = "HOME")}>
Home
</button>
<button class="menuButton" on:click={() => currentScreen = "credentials"}>
<button
class="menuButton"
on:click={() => ($state.CURRENT_PAGE = "CREDENTIALS")}
>
Credentials
</button>
<button class="menuButton" on:click={() => currentScreen = "Prompt"}>
<button class="menuButton" on:click={() => ($state.CURRENT_PAGE = "PROMPT")}>
Prompt
</button>
</div>

<section>

{#if currentScreen === "home"}
<Home/>
{:else if currentScreen === "credentials"}
<Credentials/>
{:else if currentScreen = "Prompt"}
<Prompt/>
{/if}

</section>


{#if $state.CURRENT_PAGE === "HOME"}
<Home />
{:else if $state.CURRENT_PAGE === "CREDENTIALS"}
<Credentials />
{:else if $state.CURRENT_PAGE === "PROMPT"}
<Prompt />
{/if}
20 changes: 18 additions & 2 deletions kuebiko_v/src/app.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@import "variables.scss";

html {
background-color: #222;
}
Expand Down Expand Up @@ -32,7 +34,6 @@ input:hover {
}
input {
display: flex;
backdrop-filter: blur(2px);
box-shadow: 5px 5px 20px rgba(0, 0, 0, 0.253);
width: 20rem;

Expand All @@ -54,7 +55,6 @@ input {
button {
display: flex;
gap: 10px;
backdrop-filter: blur(2px);
box-shadow: 5px 5px 20px rgba(0, 0, 0, 0.253);

background-color: #e03400;
Expand Down Expand Up @@ -156,3 +156,19 @@ textarea:focus {
background-color: white;
border-color: #333333;
}

::-webkit-scrollbar {
width: 10px;
-webkit-appearance: auto;
}
::-webkit-scrollbar-track {
background: $darkest;
padding: 2.25em 1.6875em;
}
::-webkit-scrollbar-thumb {
background: $darker;
border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
background: $dark;
}
11 changes: 11 additions & 0 deletions kuebiko_v/src/global.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
declare type Model = "DAVINCI" | "LLAMA" | "GPTTURBO" | "CUSTOMGPT";
declare type Page = "HOME" | "SETTINGS" | "ABOUT" | "CREDENTIALS" | "PROMPT";

declare interface State {
CURRENT_MODEL: Model;
CURRENT_PAGE: Page;
TWITCH_TOKEN: string;
TWITCH_CHANNEL: string;
OPEN_API_KEY: string;
PROMPT: string;
}
Loading

0 comments on commit fcbe5a9

Please sign in to comment.