-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: add tmdb map support * feat: add ci
- Loading branch information
Showing
12 changed files
with
643 additions
and
182 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
name: build | ||
|
||
on: | ||
push: | ||
branches: | ||
- "main" | ||
tags: | ||
- "v*" | ||
pull_request: | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
test: | ||
name: Test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
# 1.20 is the last version to support Windows < 10, Server < 2016, and MacOS < 1.15. | ||
- name: Set up Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: "1.20.7" | ||
cache: true | ||
|
||
- name: Test | ||
run: go test -v ./... | ||
|
||
goreleaserbuild: | ||
name: Build Go binaries | ||
if: github.event_name == 'pull_request' | ||
runs-on: ubuntu-latest | ||
needs: test | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
# 1.20 is the last version to support Windows < 10, Server < 2016, and MacOS < 1.15. | ||
- name: Set up Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: "1.20.7" | ||
cache: true | ||
|
||
- name: Run GoReleaser build | ||
uses: goreleaser/goreleaser-action@v4 | ||
with: | ||
distribution: goreleaser | ||
version: latest | ||
args: release --clean --skip-validate --skip-publish --parallelism 99 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Upload assets | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: shinkrodb | ||
path: | | ||
dist/*.tar.gz | ||
dist/*.zip | ||
goreleaser: | ||
name: Build and publish binaries | ||
if: startsWith(github.ref, 'refs/tags/') | ||
runs-on: ubuntu-latest | ||
needs: test | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
# 1.20 is the last version to support Windows < 10, Server < 2016, and MacOS < 1.15. | ||
- name: Set up Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: "1.20.7" | ||
cache: true | ||
|
||
- name: Run GoReleaser build and publish tags | ||
uses: goreleaser/goreleaser-action@v4 | ||
with: | ||
distribution: goreleaser | ||
version: latest | ||
args: release --clean | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Upload assets | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: shinkrodb | ||
path: | | ||
dist/*.tar.gz | ||
dist/*.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
*secrets.json | ||
*mal_cache | ||
*mal_cache | ||
*dist* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
project_name: shinkrodb | ||
before: | ||
hooks: | ||
- go mod tidy | ||
|
||
builds: | ||
- main: ./cmd/shinkrodb/ | ||
binary: shinkrodb | ||
env: | ||
- CGO_ENABLED=0 | ||
goos: | ||
- linux | ||
goarch: | ||
- amd64 | ||
- arm | ||
- arm64 | ||
goarm: | ||
- "6" | ||
ignore: | ||
- goos: freebsd | ||
goarch: arm | ||
- goos: freebsd | ||
goarch: arm64 | ||
|
||
archives: | ||
- name_template: "{{ .ProjectName }}_v{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}" | ||
|
||
checksum: | ||
name_template: "{{ .ProjectName }}_{{ .Version }}_checksums.txt" | ||
|
||
snapshot: | ||
name_template: "{{ incpatch .Version }}-next" | ||
|
||
changelog: | ||
sort: asc | ||
use: github | ||
filters: | ||
exclude: | ||
- Merge pull request | ||
- Merge remote-tracking branch | ||
- Merge branch | ||
groups: | ||
- title: "New Features" | ||
regexp: "^.*feat[(\\w)]*:+.*$" | ||
order: 0 | ||
- title: "Bug fixes" | ||
regexp: "^.*fix[(\\w)]*:+.*$" | ||
order: 10 | ||
- title: Other work | ||
order: 999 | ||
|
||
release: | ||
prerelease: auto | ||
footer: | | ||
**Full Changelog**: https://github.com/varoOP/shinkrodb/compare/{{ .PreviousTag }}...{{ .Tag }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,35 @@ | ||
package main | ||
|
||
import ( | ||
"fmt" | ||
"path" | ||
|
||
"github.com/spf13/pflag" | ||
"github.com/varoOP/shinkrodb/internal/config" | ||
"github.com/varoOP/shinkrodb/internal/domain" | ||
) | ||
|
||
func main() { | ||
cfg := config.NewConfig() | ||
//domain.GetMalIds(cfg) | ||
//domain.ScrapeMal() | ||
//domain.GetTvdbIDs() | ||
domain.GetTmdbIds(cfg) | ||
// a := domain.GetAnime("./malid-anidbid-tvdbid-tmdbid.json") | ||
// fmt.Println("Total number of dupes:", domain.CheckDupes(a)) | ||
var rootPath string | ||
pflag.StringVar(&rootPath, "rootPath", ".", "the path where output is saved") | ||
pflag.Parse() | ||
|
||
switch cmd := pflag.Arg(0); cmd { | ||
case "run": | ||
domain.GetMalIds(cfg) | ||
domain.ScrapeMal() | ||
domain.GetTvdbIDs() | ||
domain.GetTmdbIds(cfg, rootPath) | ||
a := domain.GetAnime("./malid-anidbid-tvdbid-tmdbid.json") | ||
fmt.Println("Total number of dupes:", domain.CheckDupes(a)) | ||
|
||
case "genmap": | ||
am := &domain.AnimeMovies{} | ||
am.Get(path.Join(rootPath, "tmdb-mal-master.yaml")) | ||
domain.CreateMapping(am, path.Join(rootPath, "tmdb-mal.yaml")) | ||
|
||
default: | ||
fmt.Println("ERROR: no command specified") | ||
} | ||
} |
Oops, something went wrong.