Skip to content

Commit

Permalink
fix: inject
Browse files Browse the repository at this point in the history
  • Loading branch information
anhoder committed Sep 9, 2023
1 parent a51cc75 commit 3149c71
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
14 changes: 7 additions & 7 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ builds:
goos:
- linux
ldflags:
- -s -w -X github.com/go-musicfox/spotifox/internal/constants.AppVersion={{.Tag}} -X github.com/go-musicfox/spotifox/internal/constants.LastfmKey={{.Env.LASTFM_KEY}} -X github.com/go-musicfox/spotifox/internal/constants.LastfmSecret={{.Env.LASTFM_SECRET}} -X github.com/go-musicfox/spotifox/internal/constants.SpotifyClientId={{.Env.SPOTIFY_CLIENT_ID}}
- -s -w -X github.com/go-musicfox/spotifox/internal/types.AppVersion={{.Tag}} -X github.com/go-musicfox/spotifox/internal/types.LastfmKey={{.Env.LASTFM_KEY}} -X github.com/go-musicfox/spotifox/internal/types.LastfmSecret={{.Env.LASTFM_SECRET}} -X github.com/go-musicfox/spotifox/internal/types.SpotifyClientId={{.Env.SPOTIFY_CLIENT_ID}}
- id: spotifox-linux-arm64
main: ./cmd/spotifox.go
binary: spotifox
Expand All @@ -34,7 +34,7 @@ builds:
- LDFLAGS=-L/usr/aarch64-linux-gnu/lib:$LDFLAGS
- PKG_CONFIG_PATH=/usr/aarch64-linux-gnu/lib/pkgconfig:$PKG_CONFIG_PATH
ldflags:
- -s -w -X github.com/go-musicfox/spotifox/internal/constants.AppVersion={{.Tag}} -X github.com/go-musicfox/spotifox/internal/constants.LastfmKey={{.Env.LASTFM_KEY}} -X github.com/go-musicfox/spotifox/internal/constants.LastfmSecret={{.Env.LASTFM_SECRET}} -X github.com/go-musicfox/spotifox/internal/constants.SpotifyClientId={{.Env.SPOTIFY_CLIENT_ID}}
- -s -w -X github.com/go-musicfox/spotifox/internal/types.AppVersion={{.Tag}} -X github.com/go-musicfox/spotifox/internal/types.LastfmKey={{.Env.LASTFM_KEY}} -X github.com/go-musicfox/spotifox/internal/types.LastfmSecret={{.Env.LASTFM_SECRET}} -X github.com/go-musicfox/spotifox/internal/types.SpotifyClientId={{.Env.SPOTIFY_CLIENT_ID}}
- id: spotifox-linux-arm
main: ./cmd/spotifox.go
binary: spotifox
Expand All @@ -50,7 +50,7 @@ builds:
- LDFLAGS=-L/usr/arm-linux-gnueabi/lib:$LDFLAGS
- PKG_CONFIG_PATH=/usr/arm-linux-gnueabi/lib/pkgconfig:$PKG_CONFIG_PATH
ldflags:
- -s -w -X github.com/go-musicfox/spotifox/internal/constants.AppVersion={{.Tag}} -X github.com/go-musicfox/spotifox/internal/constants.LastfmKey={{.Env.LASTFM_KEY}} -X github.com/go-musicfox/spotifox/internal/constants.LastfmSecret={{.Env.LASTFM_SECRET}} -X github.com/go-musicfox/spotifox/internal/constants.SpotifyClientId={{.Env.SPOTIFY_CLIENT_ID}}
- -s -w -X github.com/go-musicfox/spotifox/internal/types.AppVersion={{.Tag}} -X github.com/go-musicfox/spotifox/internal/types.LastfmKey={{.Env.LASTFM_KEY}} -X github.com/go-musicfox/spotifox/internal/types.LastfmSecret={{.Env.LASTFM_SECRET}} -X github.com/go-musicfox/spotifox/internal/types.SpotifyClientId={{.Env.SPOTIFY_CLIENT_ID}}
- id: spotifox-windows-amd64
main: ./cmd/spotifox.go
binary: spotifox
Expand All @@ -59,7 +59,7 @@ builds:
goos:
- windows
ldflags:
- -s -w -X github.com/go-musicfox/spotifox/internal/constants.AppVersion={{.Tag}} -X github.com/go-musicfox/spotifox/internal/constants.LastfmKey={{.Env.LASTFM_KEY}} -X github.com/go-musicfox/spotifox/internal/constants.LastfmSecret={{.Env.LASTFM_SECRET}} -X github.com/go-musicfox/spotifox/internal/constants.SpotifyClientId={{.Env.SPOTIFY_CLIENT_ID}}
- -s -w -X github.com/go-musicfox/spotifox/internal/types.AppVersion={{.Tag}} -X github.com/go-musicfox/spotifox/internal/types.LastfmKey={{.Env.LASTFM_KEY}} -X github.com/go-musicfox/spotifox/internal/types.LastfmSecret={{.Env.LASTFM_SECRET}} -X github.com/go-musicfox/spotifox/internal/types.SpotifyClientId={{.Env.SPOTIFY_CLIENT_ID}}
env:
- CC=/usr/local/mingw/bin/x86_64-w64-mingw32-gcc
- CXX=/usr/local/mingw/bin/x86_64-w64-mingw32-g++
Expand All @@ -74,7 +74,7 @@ builds:
goos:
- windows
ldflags:
- -s -w -X github.com/go-musicfox/spotifox/internal/constants.AppVersion={{.Tag}} -X github.com/go-musicfox/spotifox/internal/constants.LastfmKey={{.Env.LASTFM_KEY}} -X github.com/go-musicfox/spotifox/internal/constants.LastfmSecret={{.Env.LASTFM_SECRET}} -X github.com/go-musicfox/spotifox/internal/constants.SpotifyClientId={{.Env.SPOTIFY_CLIENT_ID}}
- -s -w -X github.com/go-musicfox/spotifox/internal/types.AppVersion={{.Tag}} -X github.com/go-musicfox/spotifox/internal/types.LastfmKey={{.Env.LASTFM_KEY}} -X github.com/go-musicfox/spotifox/internal/types.LastfmSecret={{.Env.LASTFM_SECRET}} -X github.com/go-musicfox/spotifox/internal/types.SpotifyClientId={{.Env.SPOTIFY_CLIENT_ID}}
env:
- CC=/usr/local/mingw/bin/aarch64-w64-mingw32-gcc
- CXX=/usr/local/mingw/bin/aarch64-w64-mingw32-g++
Expand All @@ -89,7 +89,7 @@ builds:
goos:
- darwin
ldflags:
- -s -w -X github.com/go-musicfox/spotifox/internal/constants.AppVersion={{.Tag}} -X github.com/go-musicfox/spotifox/internal/constants.LastfmKey={{.Env.LASTFM_KEY}} -X github.com/go-musicfox/spotifox/internal/constants.LastfmSecret={{.Env.LASTFM_SECRET}} -X github.com/go-musicfox/spotifox/internal/constants.SpotifyClientId={{.Env.SPOTIFY_CLIENT_ID}}
- -s -w -X github.com/go-musicfox/spotifox/internal/types.AppVersion={{.Tag}} -X github.com/go-musicfox/spotifox/internal/types.LastfmKey={{.Env.LASTFM_KEY}} -X github.com/go-musicfox/spotifox/internal/types.LastfmSecret={{.Env.LASTFM_SECRET}} -X github.com/go-musicfox/spotifox/internal/types.SpotifyClientId={{.Env.SPOTIFY_CLIENT_ID}}
env:
- CC=oa64-clang
- CXX=oa64-clang++
Expand All @@ -101,7 +101,7 @@ builds:
goos:
- darwin
ldflags:
- -s -w -X github.com/go-musicfox/spotifox/internal/constants.AppVersion={{.Tag}} -X github.com/go-musicfox/spotifox/internal/constants.LastfmKey={{.Env.LASTFM_KEY}} -X github.com/go-musicfox/spotifox/internal/constants.LastfmSecret={{.Env.LASTFM_SECRET}} -X github.com/go-musicfox/spotifox/internal/constants.SpotifyClientId={{.Env.SPOTIFY_CLIENT_ID}}
- -s -w -X github.com/go-musicfox/spotifox/internal/types.AppVersion={{.Tag}} -X github.com/go-musicfox/spotifox/internal/types.LastfmKey={{.Env.LASTFM_KEY}} -X github.com/go-musicfox/spotifox/internal/types.LastfmSecret={{.Env.LASTFM_SECRET}} -X github.com/go-musicfox/spotifox/internal/types.SpotifyClientId={{.Env.SPOTIFY_CLIENT_ID}}
env:
- CC=o64-clang
- CXX=o64-clang++
Expand Down
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ INJECT_PACKAGE ?= github.com/go-musicfox/spotify/pkg/constants
LDFLAGS := -s -w
LASTFM_KEY ?=
LASTFM_SECRET ?=
SPOTIFY_CLIENT_ID ?=
REGISTRY ?=
GORELEASER_IMAGE ?= alanalbert/goreleaser-musicfox:$(GOLANG_CROSS_VERSION)

Expand Down Expand Up @@ -80,6 +81,7 @@ release-debug-shell:
-it \
--rm \
--privileged \
--env-file .release-env \
-e CGO_ENABLED=1 \
-v /var/run/docker.sock:/var/run/docker.sock \
-v `pwd`:/go/src/$(PACKAGE_NAME) \
Expand Down
4 changes: 2 additions & 2 deletions internal/configs/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,11 @@ func NewRegistryFromIniFile(filepath string) *Registry {
registry.Main.DualColumn = ini.Bool("main.dualColumn", true)

registry.Main.LastfmKey = types.LastfmKey
if key := ini.Get("main.lastfmKey"); key != "" {
if key := ini.String("main.lastfmKey"); key != "" {
registry.Main.LastfmKey = key
}
registry.Main.LastfmSecret = types.LastfmSecret
if secret := ini.Get("main.lastfmSecret"); secret != "" {
if secret := ini.String("main.lastfmSecret"); secret != "" {
registry.Main.LastfmSecret = secret
}

Expand Down

0 comments on commit 3149c71

Please sign in to comment.