diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index ffabb013..573661ce 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -4,10 +4,10 @@ "dockerfile": "Dockerfile", "args": { // Update the VARIANT arg to pick a version of Go: 1, 1.15, 1.14 - "VARIANT": "1.21", + "VARIANT": "1.22", // Options "INSTALL_NODE": "true", - "NODE_VERSION": "v18" + "NODE_VERSION": "v20" } }, "workspaceMount": "", diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index 11ab19b6..f1b4ee97 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -19,15 +19,15 @@ jobs: - name: Install taglib run: sudo apt-get install libtag1-dev - - name: Set up Go 1.21 - uses: actions/setup-go@v3 + - name: Set up Go + uses: actions/setup-go@v5 with: - go-version: 1.21.x + go-version: 1.22.x - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: golangci-lint - uses: golangci/golangci-lint-action@v3 + uses: golangci/golangci-lint-action@v4 with: version: latest github-token: ${{ secrets.GITHUB_TOKEN }} @@ -51,7 +51,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - go_version: [1.21.x, 1.20.x] + go_version: [1.22.x, 1.21.x] steps: - name: Update ubuntu repo run: sudo apt-get update @@ -60,10 +60,10 @@ jobs: run: sudo apt-get install libtag1-dev ffmpeg - name: Check out code into the Go module directory - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Go ${{ matrix.go_version }} - uses: actions/setup-go@v3 + uses: actions/setup-go@v5 with: go-version: ${{ matrix.go_version }} cache: true @@ -83,10 +83,10 @@ jobs: env: NODE_OPTIONS: "--max_old_space_size=4096" steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: - node-version: 18 + node-version: 20 cache: "npm" cache-dependency-path: "**/package-lock.json" @@ -110,7 +110,7 @@ jobs: cd ui npm run build - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: name: js-bundle path: ui/build @@ -122,17 +122,17 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout Code - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: js-bundle path: ui/build - name: Config /github/workspace folder as trusted - uses: docker://deluan/ci-goreleaser:1.21.5-1 + uses: docker://deluan/ci-goreleaser:1.22.0-1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: @@ -140,7 +140,7 @@ jobs: - name: Run GoReleaser - SNAPSHOT if: startsWith(github.ref, 'refs/tags/') != true - uses: docker://deluan/ci-goreleaser:1.21.5-1 + uses: docker://deluan/ci-goreleaser:1.22.0-1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: @@ -148,13 +148,13 @@ jobs: - name: Run GoReleaser - RELEASE if: startsWith(github.ref, 'refs/tags/') - uses: docker://deluan/ci-goreleaser:1.21.5-1 + uses: docker://deluan/ci-goreleaser:1.22.0-1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: args: goreleaser release --clean - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: name: binaries path: | @@ -172,18 +172,18 @@ jobs: steps: - name: Set up QEMU id: qemu - uses: docker/setup-qemu-action@v2 + uses: docker/setup-qemu-action@v3 if: env.DOCKER_IMAGE != '' - name: Set up Docker Buildx id: buildx - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v3 if: env.DOCKER_IMAGE != '' - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 if: env.DOCKER_IMAGE != '' - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 if: env.DOCKER_IMAGE != '' with: name: binaries @@ -191,14 +191,14 @@ jobs: - name: Login to Docker Hub if: env.DOCKER_IMAGE != '' - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - name: Login to GitHub Container Registry if: env.DOCKER_IMAGE != '' - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.actor }} @@ -207,7 +207,7 @@ jobs: - name: Extract metadata for Docker if: env.DOCKER_IMAGE != '' id: meta - uses: docker/metadata-action@v4 + uses: docker/metadata-action@v5 with: labels: | maintainer=deluan @@ -221,7 +221,7 @@ jobs: - name: Build and Push if: env.DOCKER_IMAGE != '' - uses: docker/build-push-action@v4 + uses: docker/build-push-action@v5 with: context: . file: .github/workflows/pipeline.dockerfile diff --git a/.nvmrc b/.nvmrc index 3f430af8..9a2a0e21 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -v18 +v20 diff --git a/Makefile b/Makefile index 09f46c55..e8481a6f 100644 --- a/Makefile +++ b/Makefile @@ -9,7 +9,7 @@ GIT_SHA=source_archive GIT_TAG=$(patsubst navidrome-%,v%,$(notdir $(PWD))) endif -CI_RELEASER_VERSION=1.21.5-1 ## https://github.com/navidrome/ci-goreleaser +CI_RELEASER_VERSION=1.22.0-1 ## https://github.com/navidrome/ci-goreleaser setup: check_env download-deps setup-git ##@1_Run_First Install dependencies and prepare development environment @echo Downloading Node dependencies... diff --git a/scanner/rescanall.go b/scanner/rescanall.go deleted file mode 100644 index a48247e3..00000000 --- a/scanner/rescanall.go +++ /dev/null @@ -1,11 +0,0 @@ -//go:build go1.21 - -package scanner - -import ( - "context" -) - -func contextWithoutCancel(ctx context.Context) context.Context { - return context.WithoutCancel(ctx) -} diff --git a/scanner/rescanall_go1.20.go b/scanner/rescanall_go1.20.go deleted file mode 100644 index e4b6b2d1..00000000 --- a/scanner/rescanall_go1.20.go +++ /dev/null @@ -1,12 +0,0 @@ -//go:build !go1.21 - -package scanner - -import ( - "context" -) - -// TODO Remove this file when we drop support for go 1.20 -func contextWithoutCancel(ctx context.Context) context.Context { - return context.TODO() -} diff --git a/scanner/scanner.go b/scanner/scanner.go index f3eb4854..fae5a9c2 100644 --- a/scanner/scanner.go +++ b/scanner/scanner.go @@ -178,7 +178,7 @@ func (s *scanner) setStatusEnd(folder string, lastUpdate time.Time) { } func (s *scanner) RescanAll(ctx context.Context, fullRescan bool) error { - ctx = contextWithoutCancel(ctx) + ctx = context.WithoutCancel(ctx) if !isScanning.TryLock() { log.Debug(ctx, "Scanner already running, ignoring request for rescan.") return ErrAlreadyScanning