Compare commits
10 Commits
e0080233b4
...
ce29b8647b
Author | SHA1 | Date | |
---|---|---|---|
ce29b8647b | |||
16228eba7b | |||
db6e9b162f | |||
03bffbda7e | |||
778a2983ed | |||
9e6b8f05a2 | |||
967f75fcf6 | |||
3d63cec5ab | |||
2eafcd0ee9 | |||
4f42e95f28 |
52
.gitea/workflows/build.yml
Normal file
52
.gitea/workflows/build.yml
Normal file
@ -0,0 +1,52 @@
|
||||
name: build
|
||||
|
||||
on:
|
||||
push:
|
||||
|
||||
jobs:
|
||||
windows:
|
||||
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
|
||||
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
|
||||
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
|
||||
run: wails build -tags webkit2_41
|
||||
- name: Archive bins
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: linux-bins
|
||||
path: build/bin
|
@ -1,28 +0,0 @@
|
||||
name: build-linux
|
||||
|
||||
on:
|
||||
push:
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
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 X-Compile dependencies
|
||||
run: apt-get update && apt-get install -y mingw-w64 nsis
|
||||
- name: install wails
|
||||
run: go install github.com/wailsapp/wails/v2/cmd/wails@latest
|
||||
- name: build
|
||||
run: wails build
|
||||
- name: Archive bins
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: dist-without-markdown
|
||||
path: |
|
||||
dist
|
||||
|
||||
|
@ -1,5 +1,10 @@
|
||||
# wails template
|
||||
This is my wails-template i am using for the *ICT-Regiomeisterschaften 2025*.
|
||||
It uses vanilla svelte with vite in the Frontend. For styling i use Flowbyte and TailwindCSS. I have setup a pipeline to build windows and linux binaries. For windows i have a working installer.
|
||||
|
||||
# README
|
||||
Feel free to use this template on your own. To set it up just run ```setup.sh```. If you're not using gitea you will have to rename the ```.gitea``` folder to ```.github```, to use the pipelines.
|
||||
|
||||
Enjoy :)
|
||||
|
||||
## Links
|
||||
|
||||
|
@ -2,6 +2,8 @@ package model
|
||||
|
||||
import (
|
||||
"log"
|
||||
"os"
|
||||
"path"
|
||||
|
||||
"gorm.io/driver/sqlite"
|
||||
"gorm.io/gorm"
|
||||
@ -20,7 +22,11 @@ type SubThing struct {
|
||||
}
|
||||
|
||||
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 {
|
||||
log.Panic(err)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user