From f043c403c5f34151a11f2f14adb6215abb8d0117 Mon Sep 17 00:00:00 2001 From: Dan Brakeley Date: Fri, 22 Mar 2024 22:43:07 -0400 Subject: [PATCH] update deps; update actions --- .github/workflows/release.yaml | 9 ++++----- .github/workflows/test.yaml | 9 +++------ build.sh | 7 +++++-- go.mod | 11 ++++++----- go.sum | 30 ++++++++++++++++++++++-------- main.go | 4 ++-- 6 files changed, 42 insertions(+), 28 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 684ce2f..54c4a41 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -8,11 +8,10 @@ jobs: name: Windows Release runs-on: windows-latest steps: - - uses: actions/checkout@v2 - - uses: egor-tensin/setup-mingw@v2 - - uses: actions/setup-go@v2 + - uses: actions/checkout@v4 + - uses: actions/setup-go@v4 with: - go-version: 1.17.7 + go-version: '1.22.x' - run: ./build.sh shell: bash - run: cp LICENSE.txt output/ @@ -24,7 +23,7 @@ jobs: type: zip directory: output filename: ../heic2png.zip - - uses: softprops/action-gh-release@v1 + - uses: softprops/action-gh-release@v2 with: draft: false prerelease: true diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 48d0342..78d1906 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -4,12 +4,9 @@ jobs: build_windows: runs-on: windows-latest steps: - - uses: actions/checkout@v2 - - uses: egor-tensin/setup-mingw@v2 - - uses: actions/setup-go@v2 + - uses: actions/checkout@v4 + - uses: actions/setup-go@v4 with: - go-version: 1.17.7 - - run: go test ./... - shell: bash + go-version: '1.22.x' - run: ./build.sh shell: bash diff --git a/build.sh b/build.sh index a5993b3..72dad94 100644 --- a/build.sh +++ b/build.sh @@ -1,4 +1,5 @@ -#!/bin/bash -e +#!/bin/bash +set -e cd $(dirname "$0") START_TIMESTAMP=$(date -u +"%Y-%m-%dT%H:%M:%SZ") echo Starting build at $START_TIMESTAMP @@ -6,6 +7,7 @@ echo Starting build at $START_TIMESTAMP echo Testing... go test ./... +set +e echo "Detecting version..." if [[ $(git status --porcelain) ]]; then echo " uncommitted changes; leaving version blank" @@ -17,8 +19,9 @@ else echo " no git version tag found" fi fi +set -e echo Building... go build -ldflags="-X \"main.Version=$TAG_VERSION\" -X \"main.BuildTimestamp=$START_TIMESTAMP\"" -o ./output/ . -echo Done +echo "Done" diff --git a/go.mod b/go.mod index 62685a3..5a27e06 100644 --- a/go.mod +++ b/go.mod @@ -1,14 +1,15 @@ module github.com/danbrakeley/heic2png -go 1.17 +go 1.22 require ( - github.com/adrium/goheif v0.0.0-20210309200126-b184a7b446fa - github.com/danbrakeley/frog v0.7.4 + github.com/adrium/goheif v0.0.0-20230113233934-ca402e77a786 + github.com/danbrakeley/frog v0.10.0 ) require ( - github.com/mattn/go-isatty v0.0.13 // indirect + github.com/mattn/go-isatty v0.0.20 // indirect + github.com/mattn/go-tty v0.0.5 // indirect github.com/rwcarlsen/goexif v0.0.0-20190401172101-9e8deecbddbd // indirect - golang.org/x/sys v0.0.0-20200116001909-b77594299b42 // indirect + golang.org/x/sys v0.18.0 // indirect ) diff --git a/go.sum b/go.sum index 809cd4a..b80d976 100644 --- a/go.sum +++ b/go.sum @@ -1,10 +1,24 @@ -github.com/adrium/goheif v0.0.0-20210309200126-b184a7b446fa h1:ISwtQHwIaKiwhFFmBOIib1o1jH3UvtKPnsEo45zsVj0= -github.com/adrium/goheif v0.0.0-20210309200126-b184a7b446fa/go.mod h1:aKVJoQ0cc9K5Xb058XSnnAxXLliR97qbSqWBlm5ca1E= -github.com/danbrakeley/frog v0.7.4 h1:hGcZZXcGkXlWniOYH5htLIK8JIb6x4Jf6WcXEq82TtM= -github.com/danbrakeley/frog v0.7.4/go.mod h1:pRQBG1/ZL/kDt6uVcqr5F5kAHvk9DFde+XTexfj2Uuo= -github.com/mattn/go-isatty v0.0.13 h1:qdl+GuBjcsKKDco5BsxPJlId98mSWNKqYA+Co0SC1yA= -github.com/mattn/go-isatty v0.0.13/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= +github.com/adrium/goheif v0.0.0-20230113233934-ca402e77a786 h1:zvgtcRb2B5gynWjm+Fc9oJZPHXwmcgyH0xCcNm6Rmo4= +github.com/adrium/goheif v0.0.0-20230113233934-ca402e77a786/go.mod h1:aKVJoQ0cc9K5Xb058XSnnAxXLliR97qbSqWBlm5ca1E= +github.com/danbrakeley/frog v0.10.0 h1:YtORqrv+3J0w/1t7GKl/I3+cDfI2xhEFKDRC5ARCYJM= +github.com/danbrakeley/frog v0.10.0/go.mod h1:p2AWOH3knZHylnQLcDqoR633mOi6UMpFVPzV9iTNPUg= +github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= +github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= +github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= +github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/mattn/go-runewidth v0.0.7/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= +github.com/mattn/go-tty v0.0.4/go.mod h1:u5GGXBtZU6RQoKV8gY5W6UhMudbR5vXnUe7j3pxse28= +github.com/mattn/go-tty v0.0.5 h1:s09uXI7yDbXzzTTfw3zonKFzwGkyYlgU3OMjqA0ddz4= +github.com/mattn/go-tty v0.0.5/go.mod h1:u5GGXBtZU6RQoKV8gY5W6UhMudbR5vXnUe7j3pxse28= github.com/rwcarlsen/goexif v0.0.0-20190401172101-9e8deecbddbd h1:CmH9+J6ZSsIjUK3dcGsnCnO41eRBOnY12zwkn5qVwgc= github.com/rwcarlsen/goexif v0.0.0-20190401172101-9e8deecbddbd/go.mod h1:hPqNNc0+uJM6H+SuU8sEs5K5IQeKccPqeSjfgcKGgPk= -golang.org/x/sys v0.0.0-20200116001909-b77594299b42 h1:vEOn+mP2zCOVzKckCZy6YsCtDblrpj/w7B9nxGNELpg= -golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= +golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= diff --git a/main.go b/main.go index 95ae4ab..f43476d 100644 --- a/main.go +++ b/main.go @@ -69,7 +69,7 @@ func main_() int { return -1 } - log := frog.New(frog.Auto, frog.FieldIndent30) + log := frog.New(frog.Auto, frog.POFieldIndent(30)) defer log.Close() // build list of files @@ -201,7 +201,7 @@ func convertHeicToPng(filenameIn, filenameOut string, forceOverwrite bool, fnPro if forceOverwrite { fOut, err = os.Create(filenameOut) } else { - fOut, err = os.OpenFile(filenameOut, os.O_RDWR|os.O_CREATE|os.O_EXCL, 0666) + fOut, err = os.OpenFile(filenameOut, os.O_RDWR|os.O_CREATE|os.O_EXCL, 0o666) } if err != nil { return fmt.Errorf("unable to create %s: %v", filenameOut, err)