mirror of
https://github.com/navidrome/navidrome.git
synced 2026-04-28 03:19:38 +00:00
Some checks are pending
Pipeline: Test, Lint, Build / Get version info (push) Waiting to run
Pipeline: Test, Lint, Build / Lint Go code (push) Waiting to run
Pipeline: Test, Lint, Build / Test Go code (push) Waiting to run
Pipeline: Test, Lint, Build / Test Go code (Windows) (push) Waiting to run
Pipeline: Test, Lint, Build / Test JS code (push) Waiting to run
Pipeline: Test, Lint, Build / Lint i18n files (push) Waiting to run
Pipeline: Test, Lint, Build / Check Docker configuration (push) Waiting to run
Pipeline: Test, Lint, Build / Build (push) Blocked by required conditions
Pipeline: Test, Lint, Build / Build-1 (push) Blocked by required conditions
Pipeline: Test, Lint, Build / Build-2 (push) Blocked by required conditions
Pipeline: Test, Lint, Build / Build-3 (push) Blocked by required conditions
Pipeline: Test, Lint, Build / Build-4 (push) Blocked by required conditions
Pipeline: Test, Lint, Build / Build-5 (push) Blocked by required conditions
Pipeline: Test, Lint, Build / Build-6 (push) Blocked by required conditions
Pipeline: Test, Lint, Build / Build-7 (push) Blocked by required conditions
Pipeline: Test, Lint, Build / Build-8 (push) Blocked by required conditions
Pipeline: Test, Lint, Build / Build-9 (push) Blocked by required conditions
Pipeline: Test, Lint, Build / Build-10 (push) Blocked by required conditions
Pipeline: Test, Lint, Build / Push to GHCR (push) Blocked by required conditions
Pipeline: Test, Lint, Build / Push to Docker Hub (push) Blocked by required conditions
Pipeline: Test, Lint, Build / Cleanup digest artifacts (push) Blocked by required conditions
Pipeline: Test, Lint, Build / Build Windows installers (push) Blocked by required conditions
Pipeline: Test, Lint, Build / Package/Release (push) Blocked by required conditions
Pipeline: Test, Lint, Build / Upload Linux PKG (push) Blocked by required conditions
* ci(windows): add skeleton go-windows job (compile-only smoke test)
* ci(windows): fix comment to reference Task 7 not Task 6
* ci(windows): harden PATH visibility and set explicit bash shell
* ci(windows): enable full go test suite and ndpgen check
* test(gotaglib): skip Unix-only permission tests on Windows
* test(lyrics): skip Windows-incompatible tests
* test(utils): skip Windows-incompatible tests
* test(mpv): skip Windows-incompatible playback tests
Skip 3 subprocess-execution tests that rely on Unix-style mpv
invocation; .bat output includes \r-terminated lines that break
argument parsing (#TBD-mpv-windows).
* test(storage): skip Windows-incompatible tests
Skip relative-path test where filepath.Join uses backslash but the
storage implementation returns a forward-slash URL path
(#TBD-path-sep-storage).
* test(storage/local): skip Windows-incompatible tests
Skip 13 tests that fail because url.Parse("file://" + windowsPath)
treats the drive letter colon as an invalid port; also skip the
Windows drive-letter path test that exposes a backslash vs
forward-slash normalisation bug (#TBD-path-sep-storage-local).
* test(playlists): skip Windows-incompatible tests
* test(model): skip Windows-incompatible tests
* test(model/metadata): skip Windows-incompatible tests
* test(core): skip Windows-incompatible tests
AbsolutePath uses filepath.Join which produces OS-native path separators;
skip the assertion test on Windows until the production code is fixed
(#TBD-path-sep-core).
* test(artwork): skip Windows-incompatible tests
Artwork readers produce OS-native path separators on Windows while tests
assert forward-slash paths; skip 11 affected tests pending a fix in
production code (#TBD-path-sep-artwork).
* test(persistence): skip Windows-incompatible tests
Skip flaky timestamp comparison (#TBD-flake-persistence) and path-separator
real-bugs (#TBD-path-sep-persistence) in FolderRepository.GetFolderUpdateInfo
which uses filepath.Clean/os.PathSeparator converting stored forward-slash paths
to backslashes on Windows.
* test(scanner): skip Windows-incompatible tests
Skip symlink tests (Unix-assumption), ndignore path-separator bugs
(#TBD-path-sep-scanner) in processLibraryEvents/resolveFolderPath where
filepath.Rel/filepath.Split return backslash paths incompatible with fs.FS
forward-slash expectations, error message mismatch on Windows, and file
format upgrade detection (#TBD-path-sep-scanner).
* test(plugins): skip Windows-incompatible tests
Add //go:build !windows tags to test files that reference the suite
bootstrap (testManager, testdataDir, createTestManager) which is only
compiled on non-Windows. Add a Windows-only suite stub that skips all
specs via BeforeEach to prevent [build failed] on Windows CI.
* test(server): skip Windows-incompatible tests
Skip createUnixSocketFile tests that rely on Unix file permission bits
(chmod/fchmod) which are not supported on Windows.
* test(nativeapi): skip Windows-incompatible tests
Skip the i18n JSON validation test that uses filepath.Join to build
embedded-FS paths; filepath.Join produces backslashes on Windows which
breaks fs.Open (embedded FS always uses forward slashes).
* test(e2e): skip Windows-incompatible tests
On Windows, SQLite holds file locks that prevent the Ginkgo TempDir
DeferCleanup from deleting the DB file. Register an explicit db.Close
DeferCleanup (LIFO before TempDir cleanup) on Windows so the file lock
is released before the temp directory is removed.
* test(windows): fix e2e AfterSuite and skip remaining scanner path test
* test(scanner): skip another Windows path-sep test (#TBD-path-sep-scanner)
* test(subsonic): skip timing-flaky test on Windows (#TBD-flake-time-resolution-subsonic)
* test(scanner): skip 'detects file moved to different folder' on Windows
* test(scanner): consolidate 'Library changes' Windows skips into BeforeEach
* test(scanner): close DB before TempDir cleanup to fix Windows file lock
* test(scanner): skip ScanFolders suite on Windows instead of closing shared DB
* ci: retrigger for Windows soak run 2/3
* ci: retrigger for Windows soak run 3/3
* ci: retrigger for Windows soak run 3/3 (take 2)
* test(scanner): skip Multi-Library suite on Windows (SQLite file lock)
* ci(windows): promote go-windows to blocking status check
* test(plugins): run platform-neutral specs on Windows, drop blanket Skip
* test(windows): make tests cross-platform instead of skipping
- subsonic: back-date submissionTime baseline by 1s so
BeTemporally(">") passes under millisecond clock resolution
- persistence: sleep briefly between Put calls so UpdatedAt is
strictly after CreatedAt on low-resolution clocks
- utils/files: close tempFile before os.Remove so the test works on
Windows (where an open handle holds a file lock)
- tests.TempFile: close the handle before returning; metadata tests
no longer leak the open file into Ginkgo's TempDir cleanup
Resolves Copilot review comments on #5380.
* test(tests): add SkipOnWindows helper to reduce boilerplate
Introduces tests.SkipOnWindows(reason) that wraps the 3-line
runtime.GOOS guard pattern used in every Windows-skipped spec.
* test(adapters): use tests.SkipOnWindows helper
* test(core): use tests.SkipOnWindows helper
* test(model): use tests.SkipOnWindows helper
* test(persistence): use tests.SkipOnWindows helper
* test(scanner): use tests.SkipOnWindows helper
* test(server): use tests.SkipOnWindows helper
* test(plugins): run pure-Go unit tests on Windows
config_validation_test, manager_loader_test, and migrate_test have no
WASM/exec dependencies and don't rely on the make-built test plugins
from plugins_suite_test.go. Let them run on Windows too.
550 lines
No EOL
17 KiB
YAML
550 lines
No EOL
17 KiB
YAML
name: "Pipeline: Test, Lint, Build"
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
tags:
|
|
- "v*"
|
|
pull_request:
|
|
branches:
|
|
- master
|
|
|
|
concurrency:
|
|
group: ${{ startsWith(github.ref, 'refs/tags/v') && 'tag' || 'branch' }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
env:
|
|
IS_RELEASE: ${{ startsWith(github.ref, 'refs/tags/') && 'true' || 'false' }}
|
|
|
|
jobs:
|
|
git-version:
|
|
name: Get version info
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
git_tag: ${{ steps.git-version.outputs.GIT_TAG }}
|
|
git_sha: ${{ steps.git-version.outputs.GIT_SHA }}
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
with:
|
|
fetch-depth: 0
|
|
fetch-tags: true
|
|
|
|
- name: Show git version info
|
|
run: |
|
|
echo "git describe (dirty): $(git describe --dirty --always --tags)"
|
|
echo "git describe --tags: $(git describe --tags `git rev-list --tags --max-count=1`)"
|
|
echo "git tag: $(git tag --sort=-committerdate | head -n 1)"
|
|
echo "github_ref: $GITHUB_REF"
|
|
echo "github_head_sha: ${{ github.event.pull_request.head.sha }}"
|
|
git tag -l
|
|
- name: Determine git current SHA and latest tag
|
|
id: git-version
|
|
run: |
|
|
GIT_TAG=$(git tag --sort=-committerdate | head -n 1)
|
|
if [ -n "$GIT_TAG" ]; then
|
|
if [[ "$GITHUB_REF" != refs/tags/* ]]; then
|
|
GIT_TAG=${GIT_TAG}-SNAPSHOT
|
|
fi
|
|
echo "GIT_TAG=$GIT_TAG" >> $GITHUB_OUTPUT
|
|
fi
|
|
GIT_SHA=$(git rev-parse --short HEAD)
|
|
PR_NUM=$(jq --raw-output .pull_request.number "$GITHUB_EVENT_PATH")
|
|
if [[ $PR_NUM != "null" ]]; then
|
|
GIT_SHA=$(echo "${{ github.event.pull_request.head.sha }}" | cut -c1-8)
|
|
GIT_SHA="pr-${PR_NUM}/${GIT_SHA}"
|
|
fi
|
|
echo "GIT_SHA=$GIT_SHA" >> $GITHUB_OUTPUT
|
|
|
|
echo "GIT_TAG=$GIT_TAG"
|
|
echo "GIT_SHA=$GIT_SHA"
|
|
|
|
go-lint:
|
|
name: Lint Go code
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
|
|
- uses: actions/setup-go@v6
|
|
with:
|
|
go-version-file: go.mod
|
|
|
|
- name: golangci-lint
|
|
uses: golangci/golangci-lint-action@v9
|
|
with:
|
|
version: latest
|
|
problem-matchers: true
|
|
args: --timeout 2m
|
|
|
|
- name: Run go goimports
|
|
run: go run golang.org/x/tools/cmd/goimports@latest -w `find . -name '*.go' | grep -v '_gen.go$' | grep -v '.pb.go$'`
|
|
- run: go mod tidy
|
|
- name: Verify no changes from goimports and go mod tidy
|
|
run: |
|
|
git status --porcelain
|
|
if [ -n "$(git status --porcelain)" ]; then
|
|
echo 'To fix this check, run "make format" and commit the changes'
|
|
exit 1
|
|
fi
|
|
|
|
- name: Run go generate
|
|
run: go generate ./...
|
|
- name: Verify no changes from go generate
|
|
run: |
|
|
git status --porcelain
|
|
if [ -n "$(git status --porcelain)" ]; then
|
|
echo 'Generated code is out of date. Run "make gen" and commit the changes'
|
|
exit 1
|
|
fi
|
|
|
|
go:
|
|
name: Test Go code
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Check out code into the Go module directory
|
|
uses: actions/checkout@v6
|
|
|
|
- uses: actions/setup-go@v6
|
|
with:
|
|
go-version-file: go.mod
|
|
|
|
- name: Download dependencies
|
|
run: go mod download
|
|
|
|
- name: Test
|
|
run: go test -shuffle=on -tags netgo,sqlite_fts5 -race ./... -v
|
|
|
|
- name: Test ndpgen
|
|
run: |
|
|
cd plugins/cmd/ndpgen
|
|
go test -shuffle=on -v
|
|
go build -o ndpgen .
|
|
./ndpgen --help
|
|
|
|
go-windows:
|
|
name: Test Go code (Windows)
|
|
runs-on: windows-2022
|
|
env:
|
|
FFMPEG_VERSION: "7.1"
|
|
FFMPEG_REPOSITORY: navidrome/ffmpeg-windows-builds
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
|
|
- uses: actions/setup-go@v6
|
|
with:
|
|
go-version-file: go.mod
|
|
|
|
- uses: msys2/setup-msys2@v2
|
|
with:
|
|
msystem: MINGW64
|
|
install: mingw-w64-x86_64-gcc
|
|
update: false
|
|
|
|
- name: Add mingw64 to PATH
|
|
shell: bash
|
|
run: echo "C:/msys64/mingw64/bin" >> $GITHUB_PATH
|
|
|
|
- name: Cache ffmpeg
|
|
id: ffmpeg-cache
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: C:\ffmpeg
|
|
key: ffmpeg-${{ env.FFMPEG_VERSION }}-win64
|
|
|
|
- name: Download ffmpeg
|
|
if: steps.ffmpeg-cache.outputs.cache-hit != 'true'
|
|
shell: pwsh
|
|
run: |
|
|
$asset = "ffmpeg-n${env:FFMPEG_VERSION}-latest-win64-gpl-${env:FFMPEG_VERSION}"
|
|
$url = "https://github.com/${env:FFMPEG_REPOSITORY}/releases/download/latest/$asset.zip"
|
|
Invoke-WebRequest -Uri $url -OutFile ffmpeg.zip
|
|
Expand-Archive ffmpeg.zip -DestinationPath C:\ffmpeg-extracted
|
|
New-Item -ItemType Directory -Force -Path C:\ffmpeg\bin | Out-Null
|
|
Copy-Item "C:\ffmpeg-extracted\$asset\bin\ffmpeg.exe" C:\ffmpeg\bin
|
|
Copy-Item "C:\ffmpeg-extracted\$asset\bin\ffprobe.exe" C:\ffmpeg\bin
|
|
|
|
- name: Add ffmpeg to PATH
|
|
shell: bash
|
|
run: echo "C:/ffmpeg/bin" >> $GITHUB_PATH
|
|
|
|
- name: Verify toolchain
|
|
shell: pwsh
|
|
run: |
|
|
go version
|
|
where.exe gcc
|
|
gcc --version
|
|
ffmpeg -version
|
|
ffprobe -version
|
|
|
|
- name: Download dependencies
|
|
shell: bash
|
|
run: go mod download
|
|
|
|
- name: Test
|
|
shell: bash
|
|
env:
|
|
CGO_ENABLED: "1"
|
|
run: go test -shuffle=on -tags netgo,sqlite_fts5 ./... -v
|
|
|
|
- name: Test ndpgen
|
|
shell: pwsh
|
|
run: |
|
|
cd plugins\cmd\ndpgen
|
|
go test -shuffle=on -v
|
|
go build -o ndpgen.exe .
|
|
.\ndpgen.exe --help
|
|
|
|
js:
|
|
name: Test JS code
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
NODE_OPTIONS: "--max_old_space_size=4096"
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
- uses: actions/setup-node@v6
|
|
with:
|
|
node-version: 24
|
|
cache: "npm"
|
|
cache-dependency-path: "**/package-lock.json"
|
|
|
|
- name: npm install dependencies
|
|
run: |
|
|
cd ui
|
|
npm ci
|
|
|
|
- name: npm lint
|
|
run: |
|
|
cd ui
|
|
npm run check-formatting && npm run lint
|
|
|
|
- name: npm test
|
|
run: |
|
|
cd ui
|
|
npm test
|
|
|
|
- name: npm build
|
|
run: |
|
|
cd ui
|
|
npm run build
|
|
|
|
i18n-lint:
|
|
name: Lint i18n files
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
- run: |
|
|
set -e
|
|
for file in resources/i18n/*.json; do
|
|
echo "Validating $file"
|
|
if ! jq empty "$file" 2>error.log; then
|
|
error_message=$(cat error.log)
|
|
line_number=$(echo "$error_message" | grep -oP 'line \K[0-9]+')
|
|
echo "::error file=$file,line=$line_number::$error_message"
|
|
exit 1
|
|
fi
|
|
done
|
|
- run: ./.github/workflows/validate-translations.sh -v
|
|
|
|
|
|
check-push-enabled:
|
|
name: Check Docker configuration
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
is_enabled: ${{ steps.check.outputs.is_enabled }}
|
|
steps:
|
|
- name: Check if Docker push is configured
|
|
id: check
|
|
run: echo "is_enabled=${{ secrets.DOCKER_HUB_USERNAME != '' }}" >> $GITHUB_OUTPUT
|
|
|
|
build:
|
|
name: Build
|
|
needs: [js, go, go-windows, go-lint, i18n-lint, git-version, check-push-enabled]
|
|
strategy:
|
|
matrix:
|
|
platform: [ linux/amd64, linux/arm64, linux/arm/v5, linux/arm/v6, linux/arm/v7, linux/386, linux/riscv64, darwin/amd64, darwin/arm64, windows/amd64, windows/386 ]
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
IS_LINUX: ${{ startsWith(matrix.platform, 'linux/') && 'true' || 'false' }}
|
|
IS_ARMV5: ${{ matrix.platform == 'linux/arm/v5' && 'true' || 'false' }}
|
|
IS_DOCKER_PUSH_CONFIGURED: ${{ needs.check-push-enabled.outputs.is_enabled == 'true' }}
|
|
DOCKER_BUILD_SUMMARY: false
|
|
GIT_SHA: ${{ needs.git-version.outputs.git_sha }}
|
|
GIT_TAG: ${{ needs.git-version.outputs.git_tag }}
|
|
steps:
|
|
- name: Sanitize platform name
|
|
id: set-platform
|
|
run: |
|
|
PLATFORM=$(echo ${{ matrix.platform }} | tr '/' '_')
|
|
echo "PLATFORM=$PLATFORM" >> $GITHUB_ENV
|
|
|
|
- uses: actions/checkout@v6
|
|
|
|
- name: Prepare Docker Buildx
|
|
uses: ./.github/actions/prepare-docker
|
|
id: docker
|
|
with:
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
hub_repository: ${{ vars.DOCKER_HUB_REPO }}
|
|
hub_username: ${{ secrets.DOCKER_HUB_USERNAME }}
|
|
hub_password: ${{ secrets.DOCKER_HUB_PASSWORD }}
|
|
|
|
- name: Build Binaries
|
|
uses: docker/build-push-action@v7
|
|
with:
|
|
context: .
|
|
file: Dockerfile
|
|
platforms: ${{ matrix.platform }}
|
|
outputs: |
|
|
type=local,dest=./output/${{ env.PLATFORM }}
|
|
target: binary
|
|
build-args: |
|
|
GIT_SHA=${{ env.GIT_SHA }}
|
|
GIT_TAG=${{ env.GIT_TAG }}
|
|
|
|
- name: Upload Binaries
|
|
uses: actions/upload-artifact@v7
|
|
with:
|
|
name: navidrome-${{ env.PLATFORM }}
|
|
path: ./output
|
|
retention-days: 7
|
|
|
|
- name: Build and push image by digest
|
|
id: push-image
|
|
if: env.IS_LINUX == 'true' && env.IS_DOCKER_PUSH_CONFIGURED == 'true' && env.IS_ARMV5 == 'false'
|
|
uses: docker/build-push-action@v7
|
|
with:
|
|
context: .
|
|
file: Dockerfile
|
|
platforms: ${{ matrix.platform }}
|
|
labels: ${{ steps.docker.outputs.labels }}
|
|
build-args: |
|
|
GIT_SHA=${{ env.GIT_SHA }}
|
|
GIT_TAG=${{ env.GIT_TAG }}
|
|
outputs: |
|
|
type=image,name=${{ steps.docker.outputs.hub_repository }},push-by-digest=true,name-canonical=true,push=${{ steps.docker.outputs.hub_enabled }}
|
|
type=image,name=ghcr.io/${{ github.repository }},push-by-digest=true,name-canonical=true,push=true
|
|
|
|
- name: Export digest
|
|
if: env.IS_LINUX == 'true' && env.IS_DOCKER_PUSH_CONFIGURED == 'true' && env.IS_ARMV5 == 'false'
|
|
run: |
|
|
mkdir -p /tmp/digests
|
|
digest="${{ steps.push-image.outputs.digest }}"
|
|
touch "/tmp/digests/${digest#sha256:}"
|
|
|
|
- name: Upload digest
|
|
uses: actions/upload-artifact@v7
|
|
if: env.IS_LINUX == 'true' && env.IS_DOCKER_PUSH_CONFIGURED == 'true' && env.IS_ARMV5 == 'false'
|
|
with:
|
|
name: digests-${{ env.PLATFORM }}
|
|
path: /tmp/digests/*
|
|
if-no-files-found: error
|
|
retention-days: 1
|
|
|
|
push-manifest-ghcr:
|
|
name: Push to GHCR
|
|
permissions:
|
|
contents: read
|
|
packages: write
|
|
runs-on: ubuntu-latest
|
|
needs: [build, check-push-enabled]
|
|
if: needs.check-push-enabled.outputs.is_enabled == 'true'
|
|
env:
|
|
REGISTRY_IMAGE: ghcr.io/${{ github.repository }}
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
|
|
- name: Download digests
|
|
uses: actions/download-artifact@v8
|
|
with:
|
|
path: /tmp/digests
|
|
pattern: digests-*
|
|
merge-multiple: true
|
|
|
|
- name: Prepare Docker Buildx
|
|
uses: ./.github/actions/prepare-docker
|
|
id: docker
|
|
with:
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Create manifest list and push to ghcr.io
|
|
working-directory: /tmp/digests
|
|
run: |
|
|
docker buildx imagetools create $(jq -cr '.tags | map(select(startswith("ghcr.io"))) | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
|
|
$(printf '${{ env.REGISTRY_IMAGE }}@sha256:%s ' *)
|
|
|
|
- name: Inspect image in ghcr.io
|
|
run: |
|
|
docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:${{ steps.docker.outputs.version }}
|
|
|
|
push-manifest-dockerhub:
|
|
name: Push to Docker Hub
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
needs: [build, check-push-enabled]
|
|
if: needs.check-push-enabled.outputs.is_enabled == 'true' && vars.DOCKER_HUB_REPO != ''
|
|
continue-on-error: true
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
|
|
- name: Download digests
|
|
uses: actions/download-artifact@v8
|
|
with:
|
|
path: /tmp/digests
|
|
pattern: digests-*
|
|
merge-multiple: true
|
|
|
|
- name: Prepare Docker Buildx
|
|
uses: ./.github/actions/prepare-docker
|
|
id: docker
|
|
with:
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
hub_repository: ${{ vars.DOCKER_HUB_REPO }}
|
|
hub_username: ${{ secrets.DOCKER_HUB_USERNAME }}
|
|
hub_password: ${{ secrets.DOCKER_HUB_PASSWORD }}
|
|
|
|
- name: Create manifest list and push to Docker Hub
|
|
uses: nick-fields/retry@v4
|
|
with:
|
|
timeout_minutes: 5
|
|
max_attempts: 3
|
|
retry_wait_seconds: 30
|
|
command: |
|
|
cd /tmp/digests
|
|
docker buildx imagetools create $(jq -cr '.tags | map(select(startswith("ghcr.io") | not)) | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
|
|
$(printf 'ghcr.io/${{ github.repository }}@sha256:%s ' *)
|
|
|
|
- name: Inspect image in Docker Hub
|
|
run: |
|
|
docker buildx imagetools inspect ${{ vars.DOCKER_HUB_REPO }}:${{ steps.docker.outputs.version }}
|
|
|
|
cleanup-digests:
|
|
name: Cleanup digest artifacts
|
|
runs-on: ubuntu-latest
|
|
needs: [push-manifest-ghcr, push-manifest-dockerhub]
|
|
if: always() && needs.push-manifest-ghcr.result == 'success'
|
|
steps:
|
|
- name: Delete unnecessary digest artifacts
|
|
env:
|
|
GH_TOKEN: ${{ github.token }}
|
|
run: |
|
|
for artifact in $(gh api repos/${{ github.repository }}/actions/artifacts | jq -r '.artifacts[] | select(.name | startswith("digests-")) | .id'); do
|
|
gh api --method DELETE repos/${{ github.repository }}/actions/artifacts/$artifact
|
|
done
|
|
|
|
msi:
|
|
name: Build Windows installers
|
|
needs: [build, git-version]
|
|
runs-on: ubuntu-24.04
|
|
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
|
|
- uses: actions/download-artifact@v8
|
|
with:
|
|
path: ./binaries
|
|
pattern: navidrome-windows*
|
|
merge-multiple: true
|
|
|
|
- name: Install Wix
|
|
run: sudo apt-get install -y wixl jq
|
|
|
|
- name: Build MSI
|
|
env:
|
|
GIT_TAG: ${{ needs.git-version.outputs.git_tag }}
|
|
run: |
|
|
rm -rf binaries/msi
|
|
sudo GIT_TAG=$GIT_TAG release/wix/build_msi.sh ${GITHUB_WORKSPACE} 386
|
|
sudo GIT_TAG=$GIT_TAG release/wix/build_msi.sh ${GITHUB_WORKSPACE} amd64
|
|
du -h binaries/msi/*.msi
|
|
|
|
- name: Upload MSI files
|
|
uses: actions/upload-artifact@v7
|
|
with:
|
|
name: navidrome-windows-installers
|
|
path: binaries/msi/*.msi
|
|
retention-days: 7
|
|
|
|
release:
|
|
name: Package/Release
|
|
needs: [build, msi]
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
package_list: ${{ steps.set-package-list.outputs.package_list }}
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
with:
|
|
fetch-depth: 0
|
|
fetch-tags: true
|
|
|
|
- uses: actions/download-artifact@v8
|
|
with:
|
|
path: ./binaries
|
|
pattern: navidrome-*
|
|
merge-multiple: true
|
|
|
|
- run: ls -lR ./binaries
|
|
|
|
- name: Set RELEASE_FLAGS for snapshot releases
|
|
if: env.IS_RELEASE == 'false'
|
|
run: echo 'RELEASE_FLAGS=--skip=publish --snapshot' >> $GITHUB_ENV
|
|
|
|
- name: Run GoReleaser
|
|
uses: goreleaser/goreleaser-action@v7
|
|
with:
|
|
version: '~> v2'
|
|
args: "release --clean -f release/goreleaser.yml ${{ env.RELEASE_FLAGS }}"
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Remove build artifacts
|
|
run: |
|
|
ls -l ./dist
|
|
rm ./dist/*.tar.gz ./dist/*.zip
|
|
|
|
- name: Upload all-packages artifact
|
|
uses: actions/upload-artifact@v7
|
|
with:
|
|
name: packages
|
|
path: dist/navidrome_0*
|
|
|
|
- id: set-package-list
|
|
name: Export list of generated packages
|
|
run: |
|
|
cd dist
|
|
set +x
|
|
ITEMS=$(ls navidrome_0* | sed 's/^navidrome_0[^_]*_linux_//' | jq -R -s -c 'split("\n")[:-1]')
|
|
echo $ITEMS
|
|
echo "package_list=${ITEMS}" >> $GITHUB_OUTPUT
|
|
|
|
upload-packages:
|
|
name: Upload Linux PKG
|
|
runs-on: ubuntu-latest
|
|
needs: [release]
|
|
strategy:
|
|
matrix:
|
|
item: ${{ fromJson(needs.release.outputs.package_list) }}
|
|
steps:
|
|
- name: Download all-packages artifact
|
|
uses: actions/download-artifact@v8
|
|
with:
|
|
name: packages
|
|
path: ./dist
|
|
|
|
- name: Upload all-packages artifact
|
|
uses: actions/upload-artifact@v7
|
|
with:
|
|
name: navidrome_linux_${{ matrix.item }}
|
|
path: dist/navidrome_0*_linux_${{ matrix.item }}
|
|
|
|
# delete-artifacts:
|
|
# name: Delete unused artifacts
|
|
# runs-on: ubuntu-latest
|
|
# needs: [upload-packages]
|
|
# steps:
|
|
# - name: Delete all-packages artifact
|
|
# env:
|
|
# GH_TOKEN: ${{ github.token }}
|
|
# run: |
|
|
# for artifact in $(gh api repos/${{ github.repository }}/actions/artifacts | jq -r '.artifacts[] | select(.name | startswith("packages")) | .id'); do
|
|
# gh api --method DELETE repos/${{ github.repository }}/actions/artifacts/$artifact
|
|
# done |