-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
52 changed files
with
2,546 additions
and
553 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
permissions: | ||
contents: write | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
#- next | ||
pull_request: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }} | ||
|
||
name: ci/cd | ||
jobs: | ||
cicd: | ||
runs-on: ${{ matrix.platform }} | ||
name: ${{ matrix.label }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- platform: "macos-latest" # for Arm based macs (M1 and above). | ||
args: "--target aarch64-apple-darwin" | ||
label: macos (silicon) | ||
- platform: "macos-latest" # for Intel based macs. | ||
args: "--target x86_64-apple-darwin" | ||
label: macos (intel) | ||
- platform: "ubuntu-22.04" # for Tauri v1 you could replace this with ubuntu-20.04. | ||
args: "" | ||
label: ubuntu | ||
- platform: "windows-latest" | ||
args: "" | ||
label: windows | ||
steps: | ||
- name: checkout codebase | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
|
||
### Install languages ### | ||
- name: setup node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
cache: "yarn" | ||
|
||
- name: setup rust | ||
uses: dtolnay/rust-toolchain@stable | ||
with: | ||
components: llvm-tools-preview | ||
|
||
### Install language dependencies ### | ||
- name: install yarn | ||
run: npm install --global yarn | ||
|
||
- name: install script dependencies | ||
run: yarn install --frozen-lockfile | ||
|
||
- name: install rust development tools | ||
uses: taiki-e/install-action@cargo-llvm-cov | ||
|
||
- name: install rust dependencies | ||
if: matrix.platform == 'ubuntu-22.04' | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y libwebkit2gtk-4.0-dev libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf | ||
- name: install macos intel target | ||
if: matrix.platform == 'macos-latest' && matrix.args == '--target x86_64-apple-darwin' | ||
run: | | ||
rustup target add x86_64-apple-darwin | ||
### Apply cache ### | ||
- name: generate Cargo.lock | ||
run: cargo generate-lockfile | ||
working-directory: ./src/core | ||
|
||
- name: cache rust dependencies | ||
uses: swatinem/rust-cache@v2 | ||
with: | ||
workspaces: "./src/core -> target" | ||
|
||
- name: configure rust compiler cache | ||
run: | | ||
echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV | ||
echo "SCCACHE_GHA_ENABLED=true" >> $GITHUB_ENV | ||
- name: cache rust compiler | ||
uses: mozilla-actions/[email protected] | ||
|
||
### Tag new version ### | ||
- name: fetch all tags | ||
run: git fetch --tags --unshallow --force | ||
|
||
- name: tag new version | ||
run: yarn tag:version | ||
|
||
### Build and test ### | ||
- name: install node dependencies | ||
run: yarn install --frozen-lockfile | ||
working-directory: ./src/ui | ||
|
||
- name: build ui | ||
run: yarn run build | ||
working-directory: ./src/ui | ||
|
||
- name: test core | ||
run: cargo test --release ${{ matrix.args }} | ||
working-directory: ./src/core | ||
|
||
- name: publish release | ||
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/next') | ||
uses: tauri-apps/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tagName: v__VERSION__ | ||
releaseName: "__VERSION__" | ||
releaseBody: "." | ||
releaseDraft: false | ||
prerelease: ${{ github.ref != 'refs/heads/main' }} | ||
projectPath: ./src/core | ||
args: ${{ matrix.args }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
on: | ||
push: | ||
pull_request: | ||
|
||
jobs: | ||
linting: | ||
runs-on: ubuntu-latest | ||
name: linting | ||
steps: | ||
- name: checkout codebase | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
|
||
### Install languages ### | ||
- name: setup node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
cache: "yarn" | ||
|
||
- name: setup rust | ||
uses: dtolnay/rust-toolchain@stable | ||
with: | ||
components: llvm-tools-preview | ||
|
||
### Install language dependencies ### | ||
- name: install yarn | ||
run: npm install --global yarn | ||
|
||
- name: install script dependencies | ||
run: yarn install --frozen-lockfile | ||
|
||
- name: install rust development tools | ||
uses: taiki-e/install-action@cargo-llvm-cov | ||
|
||
- name: install rust dependencies | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y libwebkit2gtk-4.0-dev libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf | ||
### Apply cache ### | ||
- name: generate Cargo.lock | ||
run: cargo generate-lockfile | ||
working-directory: ./src/core | ||
|
||
- name: cache rust dependencies | ||
uses: swatinem/rust-cache@v2 | ||
with: | ||
workspaces: "./src/core -> target" | ||
|
||
- name: configure rust compiler cache | ||
run: | | ||
echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV | ||
echo "SCCACHE_GHA_ENABLED=true" >> $GITHUB_ENV | ||
- name: cache rust compiler | ||
uses: mozilla-actions/[email protected] | ||
|
||
### Build client ### | ||
- name: install node dependencies | ||
run: yarn install --frozen-lockfile | ||
working-directory: ./src/ui | ||
|
||
- name: build ui | ||
run: yarn run build | ||
working-directory: ./src/ui | ||
|
||
### Linting ### | ||
- name: run clippy | ||
run: cargo clippy --all-targets --all-features | ||
working-directory: ./src/core | ||
|
||
- name: run eslint | ||
run: yarn run lint | ||
working-directory: ./src/ui |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -602,3 +602,4 @@ speech-recognition.bin | |
test-results.json | ||
src-client/build | ||
.DS_Store | ||
/__keys |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,21 @@ | ||
{ | ||
"name": "@somfic/vla", | ||
"author": "somfic", | ||
"version": "0.3.0", | ||
"version": "0.1.0-next.12", | ||
"scripts": { | ||
"tauri": "cd src && cd packager && tauri", | ||
"tag:version": "npx tsx scripts/tag-version.ts" | ||
"tauri": "cd src && cd core && tauri", | ||
"tag:version": "npx tsx scripts/tag-version.ts", | ||
"test": "cd src && cd core && cargo test", | ||
"dev": "yarn tauri dev", | ||
"build": "yarn tauri build", | ||
"generate:types": "cd src && cd core && cargo run -- --generate-type-schemas && cd .. && cd .. && npx tsx scripts/generate-types.ts" | ||
}, | ||
"license": "ISC", | ||
"private": true, | ||
"devDependencies": { | ||
"glob": "^10.3.16" | ||
"@tauri-apps/cli": "^1.5.13", | ||
"glob": "^10.3.12", | ||
"json-schema-to-typescript": "^14.0.4", | ||
"tsx": "^4.9.3" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { compile, compileFromFile } from "json-schema-to-typescript"; | ||
import { glob } from "glob"; | ||
import { writeFileSync } from "fs"; | ||
import { resolve } from "path"; | ||
|
||
const files = glob.sync("src/*.schema.json"); | ||
|
||
console.log("Found", files.length, "files to process: ", files); | ||
|
||
files.forEach(async (file) => { | ||
const ts = await compileFromFile(file); | ||
const tsFile = file.replace(".schema.json", ".d.ts").split("\\").pop(); | ||
const path = resolve("src", "ui", "src", "lib", "models", tsFile); | ||
|
||
writeFileSync(path, ts); | ||
}); |
Oops, something went wrong.