diff --git a/.github/workflows/goreleaser.yml b/.github/workflows/goreleaser.yml
new file mode 100644
index 0000000..4c25ec2
--- /dev/null
+++ b/.github/workflows/goreleaser.yml
@@ -0,0 +1,15 @@
+name: Go CI and Release
+
+on:
+ push:
+ branches:
+ - '**'
+ tags:
+ - '*'
+ pull_request:
+ branches:
+ - '**'
+
+jobs:
+ build:
+ uses: TheCacophonyProject/github-actions-templates/.github/workflows/go-ci-release.yml@v0.1.1
diff --git a/.goreleaser.yml b/.goreleaser.yml
index c0eb93f..729d6ba 100644
--- a/.goreleaser.yml
+++ b/.goreleaser.yml
@@ -1,4 +1,7 @@
project_name: thermal-uploader
+
+version: 2
+
release:
github:
owner: TheCacophonyProject
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index 697d687..0000000
--- a/.travis.yml
+++ /dev/null
@@ -1,19 +0,0 @@
-language: go
-
-go:
- - "1.22.x"
-
-script:
- - go mod tidy
- - git diff --exit-code || (echo "Please run 'go mod tidy' to clean up the 'go.mod' and 'go.sum' files. Your go version should match the one used with travis."; false)
- - go vet ./...
- - go test ./...
- - curl -sL https://git.io/goreleaser | bash -s check
-
-deploy:
-- provider: script
- skip_cleanup: true
- script: curl -sL https://git.io/goreleaser | bash
- on:
- tags: true
- go: "1.22.x"
diff --git a/randstring.go b/randstring.go
deleted file mode 100644
index 2d7096f..0000000
--- a/randstring.go
+++ /dev/null
@@ -1,48 +0,0 @@
-// thermal-uploader - upload thermal video recordings in CPTV format to the project's API server.
-// Copyright (C) 2017, The Cacophony Project
-//
-// This program is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program. If not, see .
-
-package main
-
-import (
- "math/rand"
- "time"
-)
-
-const (
- chars = "abcdefghijklmnopqrstuvwxyz0123456789"
- charIdxBits = 6 // 6 bits to represent a char index
- charIdxMax = 63 / charIdxBits // # of char indices fitting in 63 bits
- charIdxMask = 1<= 0; {
- if remain == 0 {
- cache, remain = randSrc.Int63(), charIdxMax
- }
- if idx := int(cache & charIdxMask); idx < len(chars) {
- b[i] = chars[idx]
- i--
- }
- cache >>= charIdxBits
- remain--
- }
- return string(b)
-}
diff --git a/uploadjob.go b/uploadjob.go
index 37240f6..56d6edf 100644
--- a/uploadjob.go
+++ b/uploadjob.go
@@ -4,7 +4,6 @@ import (
"bufio"
"encoding/json"
"fmt"
- "io/ioutil"
"os"
"os/exec"
"path/filepath"
@@ -271,7 +270,7 @@ type metadata map[string]interface{}
func loadMeta(filename string) (metadata, error) {
var meta metadata
- byteValue, err := ioutil.ReadFile(filename)
+ byteValue, err := os.ReadFile(filename)
if err != nil {
return meta, err
}