Compare commits
1 Commits
Author | SHA1 | Date | |
---|---|---|---|
64e2603542 |
100
.gitea/workflows/publish.yaml
Normal file
100
.gitea/workflows/publish.yaml
Normal file
@@ -0,0 +1,100 @@
|
|||||||
|
# TODO: Need to install node here... How the fuck am I going to cache that bullshit...
|
||||||
|
# Figure out how to cache bullshit node
|
||||||
|
name: Release
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- 'v*.*.*'
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
Publish:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
RUNNER_TOOL_CACHE: /opt/hostedtoolcache
|
||||||
|
GOMODCACHE: /opt/hostedtoolcache/go/pkg/mod
|
||||||
|
steps:
|
||||||
|
- name: Check out repository code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Get Go
|
||||||
|
uses: actions/setup-go@v3
|
||||||
|
with:
|
||||||
|
go-version-file: 'go.mod'
|
||||||
|
check-latest: true
|
||||||
|
cache: true
|
||||||
|
|
||||||
|
- name: Setup Wails
|
||||||
|
run: |
|
||||||
|
# Install Wails CLI (if needed)
|
||||||
|
go install github.com/wailsapp/wails/v2/cmd/wails@latest
|
||||||
|
|
||||||
|
- name: Build wails
|
||||||
|
run: wails build -platform darwin/amd64,darwin/arm64,windows/amd64,windows/arm64,linux/amd64,linux/arm64
|
||||||
|
|
||||||
|
- name: Create Release
|
||||||
|
uses: actions/create-release@v1
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
with:
|
||||||
|
tag_name: ${{ github.ref }}
|
||||||
|
release_name: Release ${{ github.ref }}
|
||||||
|
body: |
|
||||||
|
Release notes for ${{ github.ref }}
|
||||||
|
|
||||||
|
- name: Upload Windows AMD64
|
||||||
|
uses: actions/upload-release-asset@v1
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
with:
|
||||||
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||||
|
asset_path: build/bin/calorie-counter-amd64.exe
|
||||||
|
asset_name: calorie-counter-amd64.exe
|
||||||
|
asset_content_type: application/octet-stream
|
||||||
|
- name: Upload Windows ARM64
|
||||||
|
uses: actions/upload-release-asset@v1
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
with:
|
||||||
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||||
|
asset_path: build/bin/calorie-counter-arm64.exe
|
||||||
|
asset_name: calorie-counter-arm64.exe
|
||||||
|
asset_content_type: application/octet-stream
|
||||||
|
- name: Upload Linux AMD64
|
||||||
|
uses: actions/upload-release-asset@v1
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
with:
|
||||||
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||||
|
asset_path: build/bin/calorie-counter-amd64.exe
|
||||||
|
asset_name: calorie-counter-amd64.exe
|
||||||
|
asset_content_type: application/octet-stream
|
||||||
|
- name: Upload Linux ARM64
|
||||||
|
uses: actions/upload-release-asset@v1
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
with:
|
||||||
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||||
|
asset_path: build/bin/calorie-counter-arm64.exe
|
||||||
|
asset_name: calorie-counter-arm64.exe
|
||||||
|
asset_content_type: application/octet-stream
|
||||||
|
- name: Upload Darwin AMD64
|
||||||
|
uses: actions/upload-release-asset@v1
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
with:
|
||||||
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||||
|
asset_path: build/bin/calorie-counter-amd64.exe
|
||||||
|
asset_name: calorie-counter-amd64.exe
|
||||||
|
asset_content_type: application/octet-stream
|
||||||
|
- name: Upload Darwin ARM64
|
||||||
|
uses: actions/upload-release-asset@v1
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
with:
|
||||||
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||||
|
asset_path: build/bin/calorie-counter-arm64.exe
|
||||||
|
asset_name: calorie-counter-arm64.exe
|
||||||
|
asset_content_type: application/octet-stream
|
@@ -34,10 +34,9 @@
|
|||||||
remainingToday = $settingsStore.target;
|
remainingToday = $settingsStore.target;
|
||||||
let now = new Date();
|
let now = new Date();
|
||||||
let todayDate = formatter.format(now);
|
let todayDate = formatter.format(now);
|
||||||
const [day, month, year] = todayDate.split("/");
|
const [day, month, year] = todayDate.split('/');
|
||||||
todayDate = `${year}-${month}-${day}`;
|
todayDate = `${year}-${month}-${day}`;
|
||||||
|
|
||||||
if ($foodStore) {
|
|
||||||
$foodStore.forEach((food) => {
|
$foodStore.forEach((food) => {
|
||||||
if (food.date.split("T")[0] == todayDate) {
|
if (food.date.split("T")[0] == todayDate) {
|
||||||
remainingToday -= food.energy;
|
remainingToday -= food.energy;
|
||||||
@@ -45,7 +44,6 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
|
||||||
remainingToday = Math.round(remainingToday);
|
remainingToday = Math.round(remainingToday);
|
||||||
computeColor();
|
computeColor();
|
||||||
}
|
}
|
||||||
|
@@ -4,7 +4,6 @@
|
|||||||
import Fa from "svelte-fa";
|
import Fa from "svelte-fa";
|
||||||
import Settings from "./Settings/Settings.svelte";
|
import Settings from "./Settings/Settings.svelte";
|
||||||
import EnergyToday from "./Energy/EnergyToday.svelte";
|
import EnergyToday from "./Energy/EnergyToday.svelte";
|
||||||
import RefreshComponent from "./RefreshComponent.svelte";
|
|
||||||
Fa;
|
Fa;
|
||||||
|
|
||||||
type Link = {
|
type Link = {
|
||||||
@@ -89,7 +88,6 @@
|
|||||||
<Fa icon={faGear} scale={2} />
|
<Fa icon={faGear} scale={2} />
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<RefreshComponent />
|
|
||||||
<EnergyToday />
|
<EnergyToday />
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
|
@@ -1,42 +0,0 @@
|
|||||||
<script lang="ts">
|
|
||||||
import { dailyFoodStore } from "$lib/store/Energy/dailyFoodStore";
|
|
||||||
import { monthlyFoodStore } from "$lib/store/Energy/monthlyFoodStore";
|
|
||||||
import { weeklyFoodStore } from "$lib/store/Energy/weeklyFoodStore";
|
|
||||||
import { yearlyFoodStore } from "$lib/store/Energy/yearlyFoodStore";
|
|
||||||
import { dailyWeightStore } from "$lib/store/Weight/dailyWeightStore";
|
|
||||||
import { monthlyWeightStore } from "$lib/store/Weight/monthlyWeightStore";
|
|
||||||
import { weeklyWeightStore } from "$lib/store/Weight/weeklyWeightStore";
|
|
||||||
import { yearlyWeightStore } from "$lib/store/Weight/yearlyWeightStore";
|
|
||||||
import { faRefresh } from "@fortawesome/free-solid-svg-icons";
|
|
||||||
import Fa from "svelte-fa";
|
|
||||||
Fa;
|
|
||||||
|
|
||||||
// YES refresh DOES exist FFS
|
|
||||||
function refreshStores() {
|
|
||||||
// @ts-ignore
|
|
||||||
dailyFoodStore.refresh();
|
|
||||||
// @ts-ignore
|
|
||||||
weeklyFoodStore.refresh();
|
|
||||||
// @ts-ignore
|
|
||||||
monthlyFoodStore.refresh();
|
|
||||||
// @ts-ignore
|
|
||||||
yearlyFoodStore.refresh();
|
|
||||||
// @ts-ignore
|
|
||||||
dailyWeightStore.refresh();
|
|
||||||
// @ts-ignore
|
|
||||||
weeklyWeightStore.refresh();
|
|
||||||
// @ts-ignore
|
|
||||||
monthlyWeightStore.refresh();
|
|
||||||
// @ts-ignore
|
|
||||||
yearlyWeightStore.refresh();
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<template>
|
|
||||||
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
|
||||||
<div class="absolute right-20 pt-4 pb-4 pr-8 pl-8 cursor-pointer" on:click={refreshStores}>
|
|
||||||
<button>
|
|
||||||
<Fa icon={faRefresh} scale={2} />
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
Reference in New Issue
Block a user