3 Commits
main ... v0.1.1

Author SHA1 Message Date
William Gill
33438c5169 typo
Some checks failed
Create Release & Upload Assets / Upload Assets To Gitea w/ goreleaser (push) Failing after 2m0s
2025-10-06 00:57:10 +00:00
William Gill
605698cff7 latest.png hack
Some checks failed
Create Release & Upload Assets / Upload Assets To Gitea w/ goreleaser (push) Failing after 2m17s
2025-10-06 00:15:11 +00:00
William Gill
b9e4d928ea workflows with an s.
Some checks failed
Create Release & Upload Assets / Upload Assets To Gitea w/ goreleaser (push) Failing after 1m46s
2025-10-05 23:49:50 +00:00
2 changed files with 11 additions and 2 deletions

View File

@@ -9,6 +9,7 @@ on:
env: env:
VERSION_TAG: '${{ github.ref_name }}' VERSION_TAG: '${{ github.ref_name }}'
CURL_TOKEN: '${{ secrets.TOKEN_GITEA }}' CURL_TOKEN: '${{ secrets.TOKEN_GITEA }}'
GPG_SIGNING_KEY: '${{ secrets.GPG_SIGNING_KEY }}'
jobs: jobs:
goreleaser: goreleaser:
@@ -34,4 +35,4 @@ jobs:
args: release --clean args: release --clean
env: env:
GITEA_TOKEN: ${{ secrets.TOKEN_GITEA }} GITEA_TOKEN: ${{ secrets.TOKEN_GITEA }}
GORELEASER_FORCE_TOKEN: gitea GORELEASER_FORCE_TOKEN: gitea

View File

@@ -8,6 +8,7 @@ import (
"image/png" "image/png"
"net/http" "net/http"
"os" "os"
"os/exec"
"strconv" "strconv"
"time" "time"
@@ -35,7 +36,7 @@ func CaptureImage() bool {
if resp.Body != nil { if resp.Body != nil {
timestamp := time.Now() timestamp := time.Now()
filename := timestamp.Format("/axis-2006-01-02_15-04-05.jpg") filename := timestamp.Format("/axis-2006-01-02_15-04-05.png")
img, _, err := image.Decode(resp.Body) img, _, err := image.Decode(resp.Body)
if err != nil { if err != nil {
@@ -53,6 +54,13 @@ func CaptureImage() bool {
log.Fatal().Err(err).Msgf("") log.Fatal().Err(err).Msgf("")
} else { } else {
log.Info().Msg("New image created: " + config.StoragePath + filename) log.Info().Msg("New image created: " + config.StoragePath + filename)
cmd := exec.Command("cp", config.StoragePath+filename, config.StoragePath+"/latest.png")
err := cmd.Run()
if err != nil {
log.Error().Msgf("Error copying to latest.")
}
} }
} }