Skip to content

Commit 3beb749

Browse files
authored
fix: new daily endpoint (#122)
* fix * fix: replace makefile with just file * chore: change logfile * fix: add debug log to print logfile location * ci: update github actions
1 parent 5dc9d2e commit 3beb749

File tree

12 files changed

+162
-130
lines changed

12 files changed

+162
-130
lines changed

.github/workflows/go.yml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
go get -u
3333
3434
- name: Snapshot
35-
uses: goreleaser/goreleaser-action@v2
35+
uses: goreleaser/goreleaser-action@v6
3636
with:
3737
args: --snapshot --clean
3838
version: latest
@@ -43,13 +43,13 @@ jobs:
4343
UNSPLASH_CLIENT_ID: ${{ secrets.CLIENT_ID }}
4444
UNSPLASH_CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }}
4545
POSTHOG_API_KEY: ${{ secrets.POSTHOG_API_KEY }}
46-
LOG_FORMAT: json
46+
LOG_FORMAT: json
4747
LOG_LEVEL: trace
4848
ENABLE_SENTRY_DEBUG: false
4949
DEBUG: true
5050

5151
- name: Upload Artifacts
52-
uses: actions/upload-artifact@v2
52+
uses: actions/upload-artifact@v4
5353
with:
5454
name: Snapshot
5555
path: dist
@@ -59,21 +59,20 @@ jobs:
5959
echo 'deb [trusted=yes] https://apt.fury.io/caarlos0/ /' | sudo tee /etc/apt/sources.list.d/caarlos0.list
6060
sudo apt update && sudo apt install svu
6161
62-
- name: Create Tag
62+
- name: Create Tag
6363
if: endsWith(github.ref, 'main')
64-
run: |
64+
run: |
6565
git tag $(svu next --strip-prefix)
6666
git push --tags
6767
68-
- name: Create Preview Tag
68+
- name: Create Preview Tag
6969
if: endsWith(github.ref, 'develop')
70-
run: |
70+
run: |
7171
git_hash=$(git rev-parse --short "$GITHUB_SHA")
7272
git_branch=${GITHUB_REF#refs/heads/}
7373
git tag $(svu prerelease --pre-release $git_branch --build $git_hash)
7474
git push --tags
7575
76-
7776
release:
7877
runs-on: ubuntu-latest
7978
if: startsWith(github.ref, 'refs/tags/')
@@ -88,7 +87,7 @@ jobs:
8887
go-version: 1.21
8988

9089
- name: Release
91-
uses: goreleaser/goreleaser-action@v2
90+
uses: goreleaser/goreleaser-action@v6
9291
with:
9392
version: latest
9493
distribution: goreleaser

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@ splash
44
splash-cli
55
.env.*
66
.env
7+
.envrc
78
dist/
89
*.log

.goreleaser.yaml

Lines changed: 37 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,33 @@
11
# This is an example .goreleaser.yml file with some sensible defaults.
22
# Make sure to check the documentation at https://goreleaser.com
3+
4+
# The lines below are called `modelines`. See `:help modeline`
5+
# Feel free to remove those if you don't want/need to use them.
6+
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
7+
# vim: set ts=2 sw=2 tw=0 fo=cnqoj
8+
9+
version: 2
10+
311
project_name: splash
12+
413
universal_binaries:
514
- name_template: splash
615
replace: false
16+
717
before:
818
hooks:
919
- go mod tidy
10-
- go test -v ./__tests__
20+
- go test -v ./__tests__/
1121
- rm -f splash-cli.log
22+
1223
builds:
1324
- binary: splash
1425
env:
1526
- CGO_ENABLED=0
27+
goos:
28+
- linux
29+
- windows
30+
- darwin
1631
ldflags:
1732
- -s -w -X "github.com/rawnly/splash-cli/config.ClientId={{ .Env.UNSPLASH_CLIENT_ID }}"
1833
- -s -w -X "github.com/rawnly/splash-cli/config.ClientSecret={{ .Env.UNSPLASH_CLIENT_SECRET }}"
@@ -24,15 +39,11 @@ builds:
2439
- -s -w -X "github.com/rawnly/splash-cli/config.Commit={{ .Commit }}"
2540
- -s -w -X "github.com/rawnly/splash-cli/config.Date={{ .Date }}"
2641
- -s -w -X "github.com/rawnly/splash-cli/config.SentryDebug={{ .Env.ENABLE_SENTRY_DEBUG }}"
27-
goos:
28-
- linux
29-
- windows
30-
- darwin
3142
brews:
3243
- name: splash-cli
33-
homepage: https://splash-cli.app
44+
homepage: https://untitled.dev
3445
license: MIT
35-
folder: Formula
46+
directory: Formula
3647
description: Splash is a command line interface for Unsplash.
3748
repository:
3849
owner: rawnly
@@ -57,16 +68,28 @@ release:
5768
```
5869
go install github.com/rawnly/splash-cli@{{ .Version }}
5970
```
60-
checksum:
61-
name_template: "checksums.txt"
62-
snapshot:
63-
name_template: "{{ incpatch .Version }}"
71+
archives:
72+
- formats: [tar.gz]
73+
# this name template makes the OS and Arch compatible with the results of `uname`.
74+
name_template: >-
75+
{{ .ProjectName }}_
76+
{{- title .Os }}_
77+
{{- if eq .Arch "amd64" }}x86_64
78+
{{- else if eq .Arch "386" }}i386
79+
{{- else }}{{ .Arch }}{{ end }}
80+
{{- if .Arm }}v{{ .Arm }}{{ end }}
81+
# use zip for windows archives
82+
format_overrides:
83+
- goos: windows
84+
formats: [zip]
85+
6486
changelog:
6587
sort: asc
6688
filters:
6789
exclude:
6890
- "^docs:"
6991
- "^test:"
70-
- "^ci:"
71-
gomod:
72-
proxy: true
92+
checksum:
93+
name_template: "checksums.txt"
94+
snapshot:
95+
name_template: "{{ incpatch .Version }}"

.goreleaser.yaml.bck

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# This is an example .goreleaser.yml file with some sensible defaults.
2+
# Make sure to check the documentation at https://goreleaser.com
3+
project_name: splash
4+
universal_binaries:
5+
- name_template: splash
6+
replace: false
7+
before:
8+
hooks:
9+
- go mod tidy
10+
- go test -v ./__tests__
11+
- rm -f splash-cli.log
12+
builds:
13+
- binary: splash
14+
env:
15+
- CGO_ENABLED=0
16+
ldflags:
17+
- -s -w -X "github.com/rawnly/splash-cli/config.ClientId={{ .Env.UNSPLASH_CLIENT_ID }}"
18+
- -s -w -X "github.com/rawnly/splash-cli/config.ClientSecret={{ .Env.UNSPLASH_CLIENT_SECRET }}"
19+
- -s -w -X "github.com/rawnly/splash-cli/config.PostHogKey={{ .Env.POSTHOG_API_KEY }}"
20+
21+
- -s -w -X "github.com/rawnly/splash-cli/config.Debug={{ .Env.DEBUG }}"
22+
- -s -w -X "github.com/rawnly/splash-cli/config.SentryDSN={{ .Env.SENTRY_DSN }}"
23+
- -s -w -X "github.com/rawnly/splash-cli/config.Version={{ .Version }}"
24+
- -s -w -X "github.com/rawnly/splash-cli/config.Commit={{ .Commit }}"
25+
- -s -w -X "github.com/rawnly/splash-cli/config.Date={{ .Date }}"
26+
- -s -w -X "github.com/rawnly/splash-cli/config.SentryDebug={{ .Env.ENABLE_SENTRY_DEBUG }}"
27+
goos:
28+
- linux
29+
- windows
30+
- darwin
31+
brews:
32+
- name: splash-cli
33+
homepage: https://untitled.dev
34+
license: MIT
35+
folder: Formula
36+
description: Splash is a command line interface for Unsplash.
37+
repository:
38+
owner: rawnly
39+
name: homebrew-tap
40+
branch: master
41+
commit_author:
42+
name: Goreleaser BOT
43+
email: goreleaser@fedevitale.dev
44+
release:
45+
prerelease: auto
46+
github:
47+
owner: rawnly
48+
name: splash-cli
49+
footer: |
50+
## How to Update
51+
### Homebrew
52+
```
53+
brew update splash-cli
54+
```
55+
56+
### Go
57+
```
58+
go install github.com/rawnly/splash-cli@{{ .Version }}
59+
```
60+
checksum:
61+
name_template: "checksums.txt"
62+
snapshot:
63+
name_template: "{{ incpatch .Version }}"
64+
changelog:
65+
sort: asc
66+
filters:
67+
exclude:
68+
- "^docs:"
69+
- "^test:"
70+
- "^ci:"
71+
gomod:
72+
proxy: true

Makefile

Lines changed: 0 additions & 20 deletions
This file was deleted.

go.mod

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
module github.com/rawnly/splash-cli
22

3-
go 1.21
3+
go 1.22.4
44

5-
toolchain go1.21.4
5+
toolchain go1.24.1
66

77
require (
88
github.com/AlecAivazis/survey/v2 v2.3.7
@@ -12,14 +12,15 @@ require (
1212
github.com/cli/browser v1.3.0
1313
github.com/eiannone/keyboard v0.0.0-20220611211555-0d226195f203
1414
github.com/getsentry/sentry-go v0.25.0
15-
github.com/google/uuid v1.5.0
15+
github.com/google/uuid v1.6.0
1616
github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d
1717
github.com/posthog/posthog-go v0.0.0-20230801140217-d607812dee69
1818
github.com/rawnly/go-wallpaper v1.0.2
1919
github.com/sirupsen/logrus v1.9.3
2020
github.com/spf13/cast v1.6.0
2121
github.com/spf13/cobra v1.8.0
2222
github.com/spf13/viper v1.18.2
23+
github.com/voxelite-ai/env v0.0.1
2324
)
2425

2526
require (

go.sum

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3Bop
3434
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
3535
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
3636
github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
37-
github.com/google/uuid v1.5.0 h1:1p67kYwdtXjb0gL0BPiP1Av9wiZPo5A8z2cWkTZ+eyU=
38-
github.com/google/uuid v1.5.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
37+
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
38+
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
3939
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
4040
github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=
4141
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
@@ -111,11 +111,14 @@ github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/
111111
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
112112
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
113113
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
114-
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
115114
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
115+
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
116+
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
116117
github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8=
117118
github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU=
118119
github.com/urfave/cli v1.22.5/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
120+
github.com/voxelite-ai/env v0.0.1 h1:Rpe2fdihal2q7S6KYVXk13ichEMOYJg/sX6//JhF4aw=
121+
github.com/voxelite-ai/env v0.0.1/go.mod h1:Ksei056hLOlNbmWVnY/fPwlz9FoLcDDdFhQEbF8bwcw=
119122
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
120123
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
121124
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=

justfile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
set dotenv-load := true
2+
set dotenv-required := true
3+
set dotenv-filename := ".envrc"
4+
5+
default:
6+
just --list
7+
8+
build:
9+
goreleaser build --snapshot --clean --single-target -o splash
10+
11+
debug:
12+
goreleaser build --snapshot --clean --single-target -o splash --auto-snapshot --verbose
13+
14+
release:
15+
goreleaser release --clean
16+
17+
test:
18+
go test -v ./... -race

package-lock.json

Lines changed: 0 additions & 32 deletions
This file was deleted.

package.json

Lines changed: 0 additions & 42 deletions
This file was deleted.

0 commit comments

Comments
 (0)