Compare commits
6 Commits
2b13e5c03a
...
main
Author | SHA1 | Date | |
---|---|---|---|
bc99e35c79 | |||
58de81e47c | |||
b3bc1c4965 | |||
d2164622c4 | |||
7bae1918c4 | |||
e55904f8f2 |
@ -4,7 +4,7 @@ on:
|
|||||||
push:
|
push:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
windows:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: https://github.com/actions/checkout@v4
|
- uses: https://github.com/actions/checkout@v4
|
||||||
@ -20,32 +20,16 @@ jobs:
|
|||||||
version: 10
|
version: 10
|
||||||
- name: install wails
|
- name: install wails
|
||||||
run: go install github.com/wailsapp/wails/v2/cmd/wails@latest
|
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
|
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
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: windows-bins
|
name: windows-bins
|
||||||
path: build/bin
|
path: build/bin
|
||||||
linux:
|
- name: build for 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
|
|
||||||
run: wails build -tags webkit2_41
|
run: wails build -tags webkit2_41
|
||||||
- name: Archive bins
|
- name: Archive linux bins
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: linux-bins
|
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"
|
"fmt"
|
||||||
|
|
||||||
"github.com/gen2brain/beeep"
|
"github.com/gen2brain/beeep"
|
||||||
|
"gorm.io/gorm"
|
||||||
)
|
)
|
||||||
|
|
||||||
// App struct
|
// App struct
|
||||||
type App struct {
|
type App struct {
|
||||||
ctx context.Context
|
ctx context.Context
|
||||||
|
db *gorm.DB
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewApp creates a new App application struct
|
// 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
|
// startup is called when the app starts. The context is saved
|
||||||
|
@ -1,12 +1,15 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<meta content="width=device-width, initial-scale=1.0" name="viewport" />
|
<meta content="width=device-width, initial-scale=1.0" name="viewport" />
|
||||||
<title>wails-svelte-tailwind-ts</title>
|
<title>wails-svelte-tailwind-ts</title>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<div id="app"></div>
|
<div id="app"></div>
|
||||||
<script src="./src/main.ts" type="module"></script>
|
<script src="./src/main.ts" type="module"></script>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
|
@ -26,7 +26,9 @@
|
|||||||
</button>
|
</button>
|
||||||
<DarkMode />
|
<DarkMode />
|
||||||
</Navbar>
|
</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 /></Route>
|
||||||
<Route path="/things/:id" let:params>
|
<Route path="/things/:id" let:params>
|
||||||
<Thing thingID={parseInt(params.id)} />
|
<Thing thingID={parseInt(params.id)} />
|
||||||
|
@ -14,7 +14,24 @@
|
|||||||
*/
|
*/
|
||||||
"allowJs": true,
|
"allowJs": true,
|
||||||
"checkJs": true,
|
"checkJs": true,
|
||||||
"isolatedModules": true
|
"isolatedModules": true,
|
||||||
|
"paths": {
|
||||||
|
"@/*": [
|
||||||
|
"src/*"
|
||||||
|
],
|
||||||
|
"@assets/*": [
|
||||||
|
"src/assets/*"
|
||||||
|
],
|
||||||
|
"@components/*": [
|
||||||
|
"src/components/*"
|
||||||
|
],
|
||||||
|
"@routes/*": [
|
||||||
|
"src/routes/*"
|
||||||
|
],
|
||||||
|
"@wails/*": [
|
||||||
|
"src/wailsjs/*"
|
||||||
|
]
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"include": [
|
"include": [
|
||||||
"src/**/*.d.ts",
|
"src/**/*.d.ts",
|
||||||
|
@ -1,7 +1,17 @@
|
|||||||
import { defineConfig } from 'vite'
|
import { defineConfig } from 'vite'
|
||||||
import { svelte } from '@sveltejs/vite-plugin-svelte'
|
import { svelte } from '@sveltejs/vite-plugin-svelte'
|
||||||
|
import path from 'path';
|
||||||
|
|
||||||
// https://vitejs.dev/config/
|
// https://vitejs.dev/config/
|
||||||
export default defineConfig({
|
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'),
|
||||||
|
},
|
||||||
|
},
|
||||||
})
|
})
|
||||||
|
2
main.go
2
main.go
@ -15,8 +15,8 @@ var assets embed.FS
|
|||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
// Create an instance of the app structure
|
// Create an instance of the app structure
|
||||||
app := NewApp()
|
|
||||||
db := model.InitDB()
|
db := model.InitDB()
|
||||||
|
app := NewApp(db)
|
||||||
things := &things.Service{DB: db}
|
things := &things.Service{DB: db}
|
||||||
|
|
||||||
// Create application with options
|
// Create application with options
|
||||||
|
Reference in New Issue
Block a user