workflow #1

Merged
schreifuchs merged 11 commits from workflow into main 2025-03-03 13:30:40 +01:00
2 changed files with 31 additions and 25 deletions
Showing only changes of commit 16228eba7b - Show all commits

View File

@ -1,32 +1,9 @@
name: build-linux name: build
on: on:
push: push:
jobs: jobs:
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
- name: Archive bins
uses: actions/upload-artifact@v3
with:
name: linux-bins
path: build/bin
windows: windows:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
@ -50,3 +27,26 @@ jobs:
with: with:
name: windows-bins name: windows-bins
path: build/bin 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
run: wails build -tags webkit2_41
- name: Archive bins
uses: actions/upload-artifact@v3
with:
name: linux-bins
path: build/bin

View File

@ -2,6 +2,8 @@ package model
import ( import (
"log" "log"
"os"
"path"
"gorm.io/driver/sqlite" "gorm.io/driver/sqlite"
"gorm.io/gorm" "gorm.io/gorm"
@ -20,7 +22,11 @@ type SubThing struct {
} }
func InitDB() *gorm.DB { func InitDB() *gorm.DB {
db, err := gorm.Open(sqlite.Open("things.db")) home, err := os.UserHomeDir()
if err != nil {
panic(err)
}
db, err := gorm.Open(sqlite.Open(path.Join(home, "things.db")))
if err != nil { if err != nil {
log.Panic(err) log.Panic(err)
} }