/
/
/
1name: Build and Push Music Assistant Server
2
3on:
4 push:
5 branches:
6 - dev-lidarr-plugin
7
8env:
9 REGISTRY: ${{ secrets.HARBOR_URL }}
10 PROJECT: docker
11 IMAGE_REPO: music-assistant-server
12 MASS_VERSION: "0.0.1.dev1"
13 # The Supervisor pulls {image}:{version} using the `version` field from the
14 # add-on repo's config.yaml, so this must match it exactly or the pull 404s.
15 ADDON_VERSION: "2.10.2-lidarr2"
16 # Must match BASE_IMAGE_VERSION_STABLE in upstream .github/workflows/release.yml.
17 # The base image ships the FFmpeg/PyAV pair the build verifies against, so
18 # floating on :latest breaks the build whenever upstream publishes a new base.
19 BASE_IMAGE_VERSION: "1.6.3"
20
21jobs:
22 build-and-push:
23 runs-on: ubuntu-latest
24 steps:
25 - name: Checkout repository
26 uses: actions/checkout@v4
27
28 - name: Set up Python
29 uses: actions/setup-python@v5
30 with:
31 # Read the pinned runtime from .python-version instead of hardcoding it,
32 # so an upstream sync cannot silently leave this workflow behind.
33 python-version-file: ".python-version"
34
35 - name: Build Python wheel
36 run: |
37 pip install build
38 python3 -m build
39
40 - name: Verify dist
41 run: |
42 ls -la dist/
43 # The Dockerfile installs this exact filename, so a drift between
44 # pyproject's version and MASS_VERSION must fail here, not mid-build.
45 test -f "dist/music_assistant-${MASS_VERSION}-py3-none-any.whl"
46
47 - name: Set up Docker Buildx
48 uses: docker/setup-buildx-action@v3
49 with:
50 driver: docker
51
52 - name: Login to Harbor Registry
53 uses: docker/login-action@v3
54 with:
55 registry: ${{ env.REGISTRY }}
56 username: ${{ secrets.HARBOR_USERNAME }}
57 password: ${{ secrets.HARBOR_PASSWORD }}
58
59 - name: Build and push image
60 uses: docker/build-push-action@v5
61 with:
62 context: .
63 push: true
64 tags: |
65 ${{ env.REGISTRY }}/${{ env.PROJECT }}/${{ env.IMAGE_REPO }}:${{ env.ADDON_VERSION }}
66 ${{ env.REGISTRY }}/${{ env.PROJECT }}/${{ env.IMAGE_REPO }}:latest
67 ${{ env.REGISTRY }}/${{ env.PROJECT }}/${{ env.IMAGE_REPO }}:${{ github.sha }}
68 build-args: |
69 MASS_VERSION=${{ env.MASS_VERSION }}
70 BASE_IMAGE_VERSION=${{ env.BASE_IMAGE_VERSION }}
71 cache-from: |
72 type=registry,ref=${{ env.REGISTRY }}/${{ env.PROJECT }}/${{ env.IMAGE_REPO }}:latest
73