diff --git a/.golangci.yml b/.golangci.yml index 44b50e09..93b4ca07 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -15,6 +15,7 @@ linters: - errcheck run: + deadline: 3m skip-dirs: - bin - - docs \ No newline at end of file + - docs diff --git a/.goreleaser.yml b/.goreleaser.yml index 46769372..44f81048 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -24,9 +24,6 @@ dockers: - 'mxpv/podsync:{{ .Tag }}' - 'mxpv/podsync:v{{ .Major }}.{{ .Minor }}' - 'mxpv/podsync:latest' - - 'docker.pkg.github.com/mxpv/podsync/cli:{{ .Tag }}' - - 'docker.pkg.github.com/mxpv/podsync/cli:v{{ .Major }}.{{ .Minor }}' - - 'docker.pkg.github.com/mxpv/podsync/cli:latest' binaries: - podsync dockerfile: Dockerfile @@ -55,4 +52,4 @@ changelog: - '^docs:' - '^test:' - Merge pull request - - Merge branch \ No newline at end of file + - Merge branch diff --git a/Dockerfile b/Dockerfile index 8c30aeba..3baf0452 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ FROM alpine:3.10 WORKDIR /app/ -RUN wget -O /usr/bin/youtube-dl https://github.com/ytdl-org/youtube-dl/releases/download/2019.11.05/youtube-dl && \ +RUN wget -O /usr/bin/youtube-dl https://github.com/ytdl-org/youtube-dl/releases/download/2020.01.24/youtube-dl && \ chmod +x /usr/bin/youtube-dl && \ apk --no-cache add ca-certificates python ffmpeg COPY podsync /app/podsync diff --git a/Makefile b/Makefile index 0b2445b8..90f78e5b 100644 --- a/Makefile +++ b/Makefile @@ -23,15 +23,20 @@ docker: # # Run goreleaser to build and upload release binaries # +V = .PHONY: release release: + test -n "$(V)" # Version is required + - git tag --delete v$(V) + git tag v$(V) goreleaser --rm-dist + git push origin --tags # # Pull GolangCI-Lint dependency # $(GOLANGCI): - curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(BINPATH) v1.17.1 + curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(BINPATH) v1.23.1 $(GOLANGCI) --version # @@ -47,3 +52,10 @@ lint: $(GOLANGCI) .PHONY: test test: go test -v ./... + +# +# Clean +# +.PHONY: clean +clean: + - rm -rf $(BINPATH) diff --git a/README.md b/README.md index 2ddef3da..8294e20c 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ brew install youtube-dl ffmpeg In order to query YouTube or Vimeo API you have to obtain an API token first. -- [How to get YouTube API key](https://elfsight.com/help/how-to-get-youtube-api-key/) +- [How to get YouTube API key](https://elfsight.com/blog/2016/12/how-to-get-youtube-api-key-tutorial/) - [Generate an access token for Vimeo](https://developer.vimeo.com/api/guides/start#generate-access-token) ## Configuration example @@ -101,12 +101,7 @@ $ docker-compose up ## How to make a release -- Add and push version tag +Just run: ``` - $ git tag -a v0.1.0 -m "First release" - $ git push origin --tags - ``` -- Run GoReleaser at the root of your repository: - ``` - $ make release + $ make release V=2.0.7 ``` diff --git a/pkg/feed/youtube_test.go b/pkg/feed/youtube_test.go index b3c030c5..80069de0 100644 --- a/pkg/feed/youtube_test.go +++ b/pkg/feed/youtube_test.go @@ -45,7 +45,7 @@ func TestYT_BuildFeed(t *testing.T) { urls := []string{ "https://youtube.com/user/fxigr1", "https://www.youtube.com/channel/UCupvZG-5ko_eiXAupbDfxWw", - "https://www.youtube.com/playlist?list=PLfVk3KMh3VX1yJShGRsJmsqAjvMIviJYQ", + "https://www.youtube.com/playlist?list=PLF7tUDhGkiCk_Ne30zu7SJ9gZF9R9ZruE", "https://www.youtube.com/channel/UCK9lZ2lHRBgx2LOcqPifukA", "https://youtube.com/user/WylsaLive", "https://www.youtube.com/playlist?list=PLUVl5pafUrBydT_gsCjRGeCy0hFHloec8", @@ -86,7 +86,7 @@ func TestYT_GetVideoCount(t *testing.T) { feeds := []*link.Info{ {Provider: link.ProviderYoutube, LinkType: link.TypeUser, ItemID: "fxigr1"}, {Provider: link.ProviderYoutube, LinkType: link.TypeChannel, ItemID: "UCupvZG-5ko_eiXAupbDfxWw"}, - {Provider: link.ProviderYoutube, LinkType: link.TypePlaylist, ItemID: "PLfVk3KMh3VX1yJShGRsJmsqAjvMIviJYQ"}, + {Provider: link.ProviderYoutube, LinkType: link.TypePlaylist, ItemID: "PLF7tUDhGkiCk_Ne30zu7SJ9gZF9R9ZruE"}, {Provider: link.ProviderYoutube, LinkType: link.TypeChannel, ItemID: "UCK9lZ2lHRBgx2LOcqPifukA"}, {Provider: link.ProviderYoutube, LinkType: link.TypeUser, ItemID: "WylsaLive"}, {Provider: link.ProviderYoutube, LinkType: link.TypePlaylist, ItemID: "PLUVl5pafUrBydT_gsCjRGeCy0hFHloec8"},