Skip to content

Commit

Permalink
latest builds debug
Browse files Browse the repository at this point in the history
  • Loading branch information
olup committed Jul 23, 2022
1 parent aabb696 commit 72357f8
Show file tree
Hide file tree
Showing 8 changed files with 114 additions and 53 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
run: |
Set-Item -Path Env:CGO_LDFLAGS -Value "-LD:/a/lunii-admin/lunii-admin/bindings/windows/lib"
Set-Item -Path Env:CGO_CFLAGS -Value "-ID:/a/lunii-admin/lunii-admin/bindings/windows/include"
wails build -o lunii-admin-windows.exe -ldflags "-v '-extldflags=-static -lm'"
wails build -debug -o lunii-admin-windows.exe -ldflags "-v '-extldflags=-static -lm'"
- uses: ncipollo/release-action@v1
with:
Expand Down Expand Up @@ -86,7 +86,7 @@ jobs:
run: go install github.com/wailsapp/wails/v2/cmd/wails@latest

- name: Build
run: wails build -o lunii-admin-linux
run: wails build -debug -o lunii-admin-linux

- uses: ncipollo/release-action@v1
with:
Expand Down Expand Up @@ -131,7 +131,7 @@ jobs:
run: go install github.com/wailsapp/wails/v2/cmd/wails@latest

- name: Build
run: wails build
run: wails build -debug

- name: Create DMG
run: |
Expand Down
19 changes: 19 additions & 0 deletions app.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@ package main

import (
"context"
"log"
"os"
"path/filepath"

"github.com/blang/semver"
"github.com/google/uuid"
"github.com/rhysd/go-github-selfupdate/selfupdate"

"github.com/olup/lunii-cli/pkg/lunii"
studiopackbuilder "github.com/olup/lunii-cli/pkg/pack-builder"
"github.com/wailsapp/wails/v2/pkg/runtime"
Expand Down Expand Up @@ -166,3 +170,18 @@ func (a *App) SyncStudioMetadata(uuids []uuid.UUID, dbPath string) (string, erro

return "", nil
}

func (a *App) CheckForUpdate() (bool, string, string) {
latest, found, err := selfupdate.DetectLatest("olup/lunii-admin")
v := semver.MustParse("0.0.3")
if err != nil {
log.Println("Error occurred while detecting version:", err)
return false, "", ""
}

if !found || latest.Version.LTE(v) {
log.Println("Current version is the latest")
return false, "", ""
}
return true, latest.Version.String(), latest.ReleaseNotes
}
3 changes: 3 additions & 0 deletions frontend/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ import {
RemovePack,
ChangePackOrder,
SyncLuniiStoreMetadata,
CheckForUpdate,
} from "../wailsjs/go/main/App";
import { lunii } from "../wailsjs/go/models";
import { DeleteModal } from "./components/DeleteModal";
Expand All @@ -68,6 +69,8 @@ function App() {
const [isInstalling, setIsInstalling] = useState(false);
const toast = useToast();

CheckForUpdate().then((r) => console.log(r));

const handleInstallStory = async () => {
setIsInstalling(true);
try {
Expand Down
22 changes: 12 additions & 10 deletions frontend/wailsjs/go/main/App.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,26 @@
import {uuid} from '../models';
import {lunii} from '../models';

export function RemovePack(arg1:uuid.UUID):Promise<boolean|Error>;

export function SyncLuniiStoreMetadata(arg1:Array<uuid.UUID>):Promise<string|Error>;

export function SyncStudioMetadata(arg1:Array<uuid.UUID>,arg2:string):Promise<string|Error>;
export function SaveFile(arg1:string,arg2:string,arg3:string):Promise<string>;

export function ChangePackOrder(arg1:uuid.UUID,arg2:number):Promise<string|Error>;

export function GetDeviceInfos():Promise<lunii.Device>;

export function InstallPack():Promise<string|Error>;

export function ListPacks():Promise<Array<lunii.Metadata>>;
export function OpenFile(arg1:string):Promise<string>;

export function OpenDirectory(arg1:string):Promise<string>;
export function RemovePack(arg1:uuid.UUID):Promise<boolean|Error>;

export function SyncStudioMetadata(arg1:Array<uuid.UUID>,arg2:string):Promise<string|Error>;

export function CheckForUpdate():Promise<boolean>;

export function CreatePack(arg1:string,arg2:string):Promise<string|Error>;

export function GetDeviceInfos():Promise<lunii.Device>;
export function ListPacks():Promise<Array<lunii.Metadata>>;

export function OpenFile(arg1:string):Promise<string>;
export function OpenDirectory(arg1:string):Promise<string>;

export function SaveFile(arg1:string,arg2:string,arg3:string):Promise<string>;
export function SyncLuniiStoreMetadata(arg1:Array<uuid.UUID>):Promise<string|Error>;
44 changes: 24 additions & 20 deletions frontend/wailsjs/go/main/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,46 +2,50 @@
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT

export function RemovePack(arg1) {
return window['go']['main']['App']['RemovePack'](arg1);
}

export function SyncLuniiStoreMetadata(arg1) {
return window['go']['main']['App']['SyncLuniiStoreMetadata'](arg1);
}

export function SyncStudioMetadata(arg1, arg2) {
return window['go']['main']['App']['SyncStudioMetadata'](arg1, arg2);
export function SaveFile(arg1, arg2, arg3) {
return window['go']['main']['App']['SaveFile'](arg1, arg2, arg3);
}

export function ChangePackOrder(arg1, arg2) {
return window['go']['main']['App']['ChangePackOrder'](arg1, arg2);
}

export function GetDeviceInfos() {
return window['go']['main']['App']['GetDeviceInfos']();
}

export function InstallPack() {
return window['go']['main']['App']['InstallPack']();
}

export function ListPacks() {
return window['go']['main']['App']['ListPacks']();
export function OpenFile(arg1) {
return window['go']['main']['App']['OpenFile'](arg1);
}

export function OpenDirectory(arg1) {
return window['go']['main']['App']['OpenDirectory'](arg1);
export function RemovePack(arg1) {
return window['go']['main']['App']['RemovePack'](arg1);
}

export function SyncStudioMetadata(arg1, arg2) {
return window['go']['main']['App']['SyncStudioMetadata'](arg1, arg2);
}

export function CheckForUpdate() {
return window['go']['main']['App']['CheckForUpdate']();
}

export function CreatePack(arg1, arg2) {
return window['go']['main']['App']['CreatePack'](arg1, arg2);
}

export function GetDeviceInfos() {
return window['go']['main']['App']['GetDeviceInfos']();
export function ListPacks() {
return window['go']['main']['App']['ListPacks']();
}

export function OpenFile(arg1) {
return window['go']['main']['App']['OpenFile'](arg1);
export function OpenDirectory(arg1) {
return window['go']['main']['App']['OpenDirectory'](arg1);
}

export function SaveFile(arg1, arg2, arg3) {
return window['go']['main']['App']['SaveFile'](arg1, arg2, arg3);
export function SyncLuniiStoreMetadata(arg1) {
return window['go']['main']['App']['SyncLuniiStoreMetadata'](arg1);
}
40 changes: 20 additions & 20 deletions frontend/wailsjs/go/models.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,5 @@
export namespace lunii {

export class Metadata {
uuid: number[];
ref: string;
title: string;
description: string;
packType: string;

static createFrom(source: any = {}) {
return new Metadata(source);
}

constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.uuid = source["uuid"];
this.ref = source["ref"];
this.title = source["title"];
this.description = source["description"];
this.packType = source["packType"];
}
}
export class Device {
mountPoint: string;
uuid: number[];
Expand Down Expand Up @@ -48,6 +28,26 @@ export namespace lunii {
this.sdCardUsed = source["sdCardUsed"];
}
}
export class Metadata {
uuid: number[];
ref: string;
title: string;
description: string;
packType: string;

static createFrom(source: any = {}) {
return new Metadata(source);
}

constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.uuid = source["uuid"];
this.ref = source["ref"];
this.title = source["title"];
this.description = source["description"];
this.packType = source["packType"];
}
}

}

10 changes: 10 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ module lunii-tools
go 1.17

require (
github.com/blang/semver v3.5.1+incompatible
github.com/google/uuid v1.3.0
github.com/olup/lunii-cli v0.0.0-20220722052415-f5ec020dcae7
github.com/rhysd/go-github-selfupdate v1.2.3
github.com/wailsapp/wails/v2 v2.0.0-beta.38
)

Expand All @@ -18,11 +20,15 @@ require (
github.com/fsnotify/fsnotify v1.5.4 // indirect
github.com/go-ole/go-ole v1.2.6 // indirect
github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/google/go-github/v30 v30.1.0 // indirect
github.com/google/go-querystring v1.0.0 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/imdario/mergo v0.3.13 // indirect
github.com/imroc/req/v3 v3.14.0 // indirect
github.com/inconshreveable/go-update v0.0.0-20160112193335-8152e7eb6ccf // indirect
github.com/jchv/go-winloader v0.0.0-20210711035445-715c2860da7e // indirect
github.com/klauspost/compress v1.15.9 // indirect
github.com/klauspost/pgzip v1.2.5 // indirect
Expand Down Expand Up @@ -51,6 +57,7 @@ require (
github.com/qiniu/x v1.11.9 // indirect
github.com/rivo/uniseg v0.2.0 // indirect
github.com/rogpeppe/go-internal v1.8.1 // indirect
github.com/tcnksm/go-gitconfig v0.1.2 // indirect
github.com/therootcompany/xz v1.0.1 // indirect
github.com/tkrajina/go-reflector v0.5.6 // indirect
github.com/tosone/minimp3 v1.0.1 // indirect
Expand All @@ -63,9 +70,12 @@ require (
golang.org/x/image v0.0.0-20220617043117-41969df76e82 // indirect
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 // indirect
golang.org/x/net v0.0.0-20220708220712-1185a9018129 // indirect
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421 // indirect
golang.org/x/sys v0.0.0-20220721230656-c6bc011c0c49 // indirect
golang.org/x/text v0.3.7 // indirect
golang.org/x/tools v0.1.11 // indirect
google.golang.org/appengine v1.4.0 // indirect
google.golang.org/protobuf v1.26.0 // indirect
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Expand Down
Loading

0 comments on commit 72357f8

Please sign in to comment.