Compare commits

...

6 Commits

Author SHA1 Message Date
bc99e35c79 add github pipeline folder
All checks were successful
build / build (push) Successful in 3m1s
2025-03-11 10:09:54 +01:00
58de81e47c mae pipeline go brr
All checks were successful
build / build (push) Successful in 3m24s
2025-03-11 09:54:47 +01:00
b3bc1c4965 add db to struct
All checks were successful
build / windows (push) Successful in 2m22s
build / linux (push) Successful in 1m54s
2025-03-11 09:49:13 +01:00
d2164622c4 clip x overflow
All checks were successful
build / windows (push) Successful in 2m25s
build / linux (push) Successful in 4m19s
2025-03-10 09:12:27 +01:00
7bae1918c4 Revert "bump upload artifact to v4"
Some checks failed
build / windows (push) Has been cancelled
build / linux (push) Has been cancelled
This reverts commit e55904f8f2.
2025-03-07 15:53:32 +01:00
e55904f8f2 bump upload artifact to v4
Some checks failed
build / windows (push) Successful in 6m23s
build / linux (push) Failing after 4m3s
2025-03-07 15:36:00 +01:00
8 changed files with 88 additions and 34 deletions

View File

@ -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
View 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
View File

@ -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

View File

@ -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>

View File

@ -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)} />

View File

@ -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",

View File

@ -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'),
},
},
})

View File

@ -15,8 +15,8 @@ var assets embed.FS
func main() {
// Create an instance of the app structure
app := NewApp()
db := model.InitDB()
app := NewApp(db)
things := &things.Service{DB: db}
// Create application with options