Skip to content

Commit

Permalink
Merge pull request #211 from dvdmuckle/dev
Browse files Browse the repository at this point in the history
Release 1.2.1
  • Loading branch information
dvdmuckle authored Jul 4, 2024
2 parents a80687f + 8663abc commit 55c352c
Show file tree
Hide file tree
Showing 9 changed files with 87 additions and 60 deletions.
4 changes: 4 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,7 @@ updates:
interval: daily
time: '10:00'
open-pull-requests-limit: 10
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
23 changes: 22 additions & 1 deletion .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
name: Build Release
on:
release:
types:
Expand All @@ -10,26 +11,34 @@ permissions:
jobs:
build:
name: release ${{ matrix.goos }}/${{ matrix.goarch }}
runs-on: ubuntu-latest
runs-on: ${{ matrix.machine }}
strategy:
matrix:
include:
- goos: linux
goarch: 386
machine: ubuntu-latest
- goos: linux
goarch: amd64
machine: ubuntu-latest
- goos: linux
goarch: arm
machine: ubuntu-latest
- goos: linux
goarch: arm64
machine: ubuntu-latest
- goos: darwin
goarch: amd64
machine: macos-latest
- goos: darwin
goarch: arm64
machine: macos-14
- goos: windows
goarch: 386
machine: ubuntu-latest
- goos: windows
goarch: amd64
machine: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: compile and release
Expand All @@ -40,3 +49,15 @@ jobs:
goos: ${{ matrix.goos }}
extra_files: "LICENSE"
ldflags: "-X github.com/dvdmuckle/spc/cmd.version=${{ github.event.release.tag_name }}"
homebrew:
name: Bump Homebrew formula
runs-on: ubuntu-latest
steps:
- uses: mislav/bump-homebrew-formula-action@v3
with:
formula-name: spc
create-pullrequest: true
homebrew-tap: dvdmuckle/homebrew-tap
tag-name: ${{ github.event.release.tag_name }}
env:
COMITTER_TOKEN: ${{ secrets.HOMEBREW_BUMP }}
6 changes: 3 additions & 3 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -53,7 +53,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1
uses: github/codeql-action/autobuild@v2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
Expand All @@ -67,4 +67,4 @@ jobs:
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
uses: github/codeql-action/analyze@v2
2 changes: 1 addition & 1 deletion .github/workflows/fedora-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ jobs:
dnf -y install copr-cli
- name: Submit the build by uploading the spec
run: copr build dvdmuckle/spc spc.spec
run: copr build --nowait dvdmuckle/spc spc.spec
11 changes: 6 additions & 5 deletions cmd/seek.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
Expand Down Expand Up @@ -36,7 +36,7 @@ exactly one argument, either a number between 0 and the length of the song in se
the form of minutes:seconds.`,
Run: func(cmd *cobra.Command, args []string) {
helper.SetClient(&conf)
var position int
var position spotify.Numeric
if strings.Contains(args[0], ":") {
var (
minutes int
Expand All @@ -47,14 +47,15 @@ the form of minutes:seconds.`,
fmt.Println("Timestamp must be numbers in the form of minutes:seconds")
os.Exit(1)
}
position = minutes*60 + seconds
position = spotify.Numeric(minutes*60 + seconds)
} else {
var err error
position, err = strconv.Atoi(args[0])
tmp, err := strconv.Atoi(args[0])
if err != nil {
fmt.Println("Passed value for seconds must be an integer.")
os.Exit(1)
}
position = spotify.Numeric(tmp)
}

ctx := context.Background()
Expand All @@ -76,7 +77,7 @@ the form of minutes:seconds.`,
os.Exit(1)
}

err = conf.Client.SeekOpt(ctx, position*1000, &spotify.PlayOptions{DeviceID: &conf.DeviceID})
err = conf.Client.SeekOpt(ctx, int(position)*1000, &spotify.PlayOptions{DeviceID: &conf.DeviceID})
if err != nil {
helper.LogErrorAndExit(err)
}
Expand Down
6 changes: 6 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
spc (1.2.1-1) jammy; urgency=medium

* Update dependencies

-- David Muckle <[email protected]> Thu, 04 Jul 2024 13:32:10 -0400

spc (1.2.0-1) jammy; urgency=medium

* Add shuffle command
Expand Down
24 changes: 10 additions & 14 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,24 @@ module github.com/dvdmuckle/spc
go 1.20

require (
github.com/golang/glog v1.2.0
github.com/golang/glog v1.2.1
github.com/ktr0731/go-fuzzyfinder v0.8.0
github.com/mitchellh/go-homedir v1.1.0
github.com/spf13/cobra v1.8.0
github.com/spf13/viper v1.18.2
github.com/zalando/go-keyring v0.2.3
github.com/zmb3/spotify/v2 v2.4.1
golang.org/x/oauth2 v0.16.0
github.com/spf13/cobra v1.8.1
github.com/spf13/viper v1.19.0
github.com/zalando/go-keyring v0.2.5
github.com/zmb3/spotify/v2 v2.4.2
golang.org/x/oauth2 v0.21.0
)

require (
github.com/alessio/shellescape v1.4.1 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.3 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.4 // indirect
github.com/danieljoos/wincred v1.2.0 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/gdamore/encoding v1.0.0 // indirect
github.com/gdamore/tcell/v2 v2.6.0 // indirect
github.com/godbus/dbus/v5 v5.1.0 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/ktr0731/go-ansisgr v0.1.0 // indirect
Expand All @@ -30,7 +29,7 @@ require (
github.com/mattn/go-runewidth v0.0.15 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/nsf/termbox-go v1.1.1 // indirect
github.com/pelletier/go-toml/v2 v2.1.0 // indirect
github.com/pelletier/go-toml/v2 v2.2.2 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/rivo/uniseg v0.4.3 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
Expand All @@ -44,12 +43,9 @@ require (
go.uber.org/atomic v1.9.0 // indirect
go.uber.org/multierr v1.9.0 // indirect
golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect
golang.org/x/net v0.20.0 // indirect
golang.org/x/sys v0.16.0 // indirect
golang.org/x/term v0.16.0 // indirect
golang.org/x/sys v0.18.0 // indirect
golang.org/x/term v0.18.0 // indirect
golang.org/x/text v0.14.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.31.0 // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
Expand Down
Loading

0 comments on commit 55c352c

Please sign in to comment.