Compare commits
6 Commits
2b13e5c03a
...
main
Author | SHA1 | Date | |
---|---|---|---|
bc99e35c79 | |||
58de81e47c | |||
b3bc1c4965 | |||
d2164622c4 | |||
7bae1918c4 | |||
e55904f8f2 |
@ -4,7 +4,7 @@ on:
|
||||
push:
|
||||
|
||||
jobs:
|
||||
windows:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: https://github.com/actions/checkout@v4
|
||||
@ -20,32 +20,16 @@ jobs:
|
||||
version: 10
|
||||
- name: install wails
|
||||
run: go install github.com/wailsapp/wails/v2/cmd/wails@latest
|
||||
- name: build
|
||||
- name: build for windows
|
||||
run: env GOOS=windows GOARCH=amd64 CGO_ENABLED=1 CC=x86_64-w64-mingw32-gcc CXX=x86_64-w64-mingw32-g++ CGO_CXXFLAGS="-IC:\msys64\mingw64\include" wails build -ldflags '-extldflags "-static"' -skipbindings -nsis
|
||||
- name: Archive bins
|
||||
- name: Archive win bins
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: windows-bins
|
||||
path: build/bin
|
||||
linux:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: https://github.com/actions/checkout@v4
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: 1.24
|
||||
- name: install apt dependencies
|
||||
run: apt-get update && apt-get install -y nodejs libgtk-3-dev libwebkit2gtk-4.1-dev
|
||||
- name: install pnpm
|
||||
uses: pnpm/action-setup@v4
|
||||
with:
|
||||
version: 10
|
||||
- name: install wails
|
||||
run: go install github.com/wailsapp/wails/v2/cmd/wails@latest
|
||||
- name: build
|
||||
- name: build for linux
|
||||
run: wails build -tags webkit2_41
|
||||
- name: Archive bins
|
||||
- name: Archive linux bins
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: linux-bins
|
||||
|
36
.github/workflows/build.yml
vendored
Normal file
36
.github/workflows/build.yml
vendored
Normal file
@ -0,0 +1,36 @@
|
||||
name: build
|
||||
|
||||
on:
|
||||
push:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: https://github.com/actions/checkout@v4
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: 1.24
|
||||
- name: install apt dependencies
|
||||
run: apt-get update && apt-get install -y mingw-w64 nsis nodejs libgtk-3-dev libwebkit2gtk-4.1-dev
|
||||
- name: install pnpm
|
||||
uses: pnpm/action-setup@v4
|
||||
with:
|
||||
version: 10
|
||||
- name: install wails
|
||||
run: go install github.com/wailsapp/wails/v2/cmd/wails@latest
|
||||
- name: build for windows
|
||||
run: env GOOS=windows GOARCH=amd64 CGO_ENABLED=1 CC=x86_64-w64-mingw32-gcc CXX=x86_64-w64-mingw32-g++ CGO_CXXFLAGS="-IC:\msys64\mingw64\include" wails build -ldflags '-extldflags "-static"' -skipbindings -nsis
|
||||
- name: Archive win bins
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: windows-bins
|
||||
path: build/bin
|
||||
- name: build for linux
|
||||
run: wails build -tags webkit2_41
|
||||
- name: Archive linux bins
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: linux-bins
|
||||
path: build/bin
|
6
app.go
6
app.go
@ -5,17 +5,19 @@ import (
|
||||
"fmt"
|
||||
|
||||
"github.com/gen2brain/beeep"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
// App struct
|
||||
type App struct {
|
||||
ctx context.Context
|
||||
db *gorm.DB
|
||||
}
|
||||
|
||||
// NewApp creates a new App application struct
|
||||
func NewApp() *App {
|
||||
func NewApp(db *gorm.DB) *App {
|
||||
|
||||
return &App{}
|
||||
return &App{db: db}
|
||||
}
|
||||
|
||||
// startup is called when the app starts. The context is saved
|
||||
|
@ -1,12 +1,15 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8"/>
|
||||
<meta content="width=device-width, initial-scale=1.0" name="viewport"/>
|
||||
<title>wails-svelte-tailwind-ts</title>
|
||||
<meta charset="UTF-8" />
|
||||
<meta content="width=device-width, initial-scale=1.0" name="viewport" />
|
||||
<title>wails-svelte-tailwind-ts</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<script src="./src/main.ts" type="module"></script>
|
||||
<div id="app"></div>
|
||||
<script src="./src/main.ts" type="module"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
@ -26,7 +26,9 @@
|
||||
</button>
|
||||
<DarkMode />
|
||||
</Navbar>
|
||||
<main class="size-full max-h-full max-w-full overflow-scroll">
|
||||
<main
|
||||
class="size-full max-h-full max-w-full overflow-y-scroll overflow-x-clip"
|
||||
>
|
||||
<Route path="/"><Things /></Route>
|
||||
<Route path="/things/:id" let:params>
|
||||
<Thing thingID={parseInt(params.id)} />
|
||||
|
@ -14,7 +14,24 @@
|
||||
*/
|
||||
"allowJs": true,
|
||||
"checkJs": true,
|
||||
"isolatedModules": true
|
||||
"isolatedModules": true,
|
||||
"paths": {
|
||||
"@/*": [
|
||||
"src/*"
|
||||
],
|
||||
"@assets/*": [
|
||||
"src/assets/*"
|
||||
],
|
||||
"@components/*": [
|
||||
"src/components/*"
|
||||
],
|
||||
"@routes/*": [
|
||||
"src/routes/*"
|
||||
],
|
||||
"@wails/*": [
|
||||
"src/wailsjs/*"
|
||||
]
|
||||
}
|
||||
},
|
||||
"include": [
|
||||
"src/**/*.d.ts",
|
||||
|
@ -1,7 +1,17 @@
|
||||
import {defineConfig} from 'vite'
|
||||
import {svelte} from '@sveltejs/vite-plugin-svelte'
|
||||
import { defineConfig } from 'vite'
|
||||
import { svelte } from '@sveltejs/vite-plugin-svelte'
|
||||
import path from 'path';
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig({
|
||||
plugins: [svelte()]
|
||||
plugins: [svelte()],
|
||||
resolve: {
|
||||
alias: {
|
||||
'@': path.resolve(__dirname, './src'),
|
||||
'@assets': path.resolve(__dirname, './src/assets'),
|
||||
'@components': path.resolve(__dirname, './src/components'),
|
||||
'@routes': path.resolve(__dirname, './src/routes'),
|
||||
'@wails': path.resolve(__dirname, './src/wailsjs'),
|
||||
},
|
||||
},
|
||||
})
|
||||
|
Reference in New Issue
Block a user