Skip to content

Commit

Permalink
wip: 2
Browse files Browse the repository at this point in the history
  • Loading branch information
arunpkio committed Jun 24, 2024
1 parent 71bbe9b commit 3ddf02a
Show file tree
Hide file tree
Showing 8 changed files with 1,836 additions and 18 deletions.
40 changes: 22 additions & 18 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,33 @@
name: Continuous deployment
name: Build and Deploy WASM

on:
workflow_run:
branches: [main]
workflows: [Continuous integration]
types: [completed]
push:
branches:
- main # or the branch you want to trigger the deployment

jobs:
release:
build:
runs-on: ubuntu-latest

steps:
- uses: actions-rs/toolchain@v1
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: wasm32-unknown-unknown

- uses: jetli/trunk-action@v0.1.0
- uses: jetli/wasm-bindgen-action@v0.1.0
profile: minimal
override: true

- uses: actions/checkout@v2
- name: Install wasm-pack
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh

# - run: trunk build --release
- run: wasm-pack build --release --target web
- name: Build with wasm-pack
run: wasm-pack build --release --target web

- uses: peaceiris/actions-gh-pages@v3
if: github.ref == 'refs/heads/main'
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: $
publish_dir: ./pkg
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./pkg
1 change: 1 addition & 0 deletions pkg/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*
3 changes: 3 additions & 0 deletions pkg/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# tymoz

A simple a Rust + SlintUI application to show time from different cities across different time zones.
17 changes: 17 additions & 0 deletions pkg/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "tymoz",
"collaborators": [
"Arun PK"
],
"version": "0.1.0",
"files": [
"tymoz_bg.wasm",
"tymoz.js",
"tymoz.d.ts"
],
"module": "tymoz.js",
"types": "tymoz.d.ts",
"sideEffects": [
"./snippets/*"
]
}
50 changes: 50 additions & 0 deletions pkg/tymoz.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/* tslint:disable */
/* eslint-disable */
/**
*/
export function main(): void;

export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;

export interface InitOutput {
readonly memory: WebAssembly.Memory;
readonly main: () => void;
readonly slint_mock_elapsed_time: (a: number) => void;
readonly slint_get_mocked_time: () => number;
readonly slint_send_mouse_click: (a: number, b: number, c: number) => void;
readonly slint_send_keyboard_char: (a: number, b: number, c: number) => void;
readonly send_keyboard_string_sequence: (a: number, b: number) => void;
readonly __wbindgen_malloc: (a: number, b: number) => number;
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
readonly __wbindgen_export_2: WebAssembly.Table;
readonly _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h2253e8007a5e5edc: (a: number, b: number, c: number) => void;
readonly _dyn_core__ops__function__FnMut__A_B___Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h571409af2633e2e4: (a: number, b: number, c: number, d: number) => void;
readonly _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h21070738c8e31518: (a: number, b: number) => void;
readonly _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h3133cab64c99989e: (a: number, b: number, c: number) => void;
readonly _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hd74be157539cc4d0: (a: number, b: number) => void;
readonly _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h14ad1df19c0f6435: (a: number, b: number, c: number) => void;
readonly _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h6ac4e95b554e6f20: (a: number, b: number, c: number) => void;
readonly __wbindgen_exn_store: (a: number) => void;
readonly __wbindgen_start: () => void;
}

export type SyncInitInput = BufferSource | WebAssembly.Module;
/**
* Instantiates the given `module`, which can either be bytes or
* a precompiled `WebAssembly.Module`.
*
* @param {SyncInitInput} module
*
* @returns {InitOutput}
*/
export function initSync(module: SyncInitInput): InitOutput;

/**
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
* for everything else, calls `WebAssembly.instantiate` directly.
*
* @param {InitInput | Promise<InitInput>} module_or_path
*
* @returns {Promise<InitOutput>}
*/
export default function __wbg_init (module_or_path?: InitInput | Promise<InitInput>): Promise<InitOutput>;
Loading

0 comments on commit 3ddf02a

Please sign in to comment.