fix: 🐛 move download to after checkout, fix conditionals (#1645)
authorJozef Kruszynski <60214390+jozefKruszynski@users.noreply.github.com>
Wed, 4 Sep 2024 07:32:55 +0000 (09:32 +0200)
committerGitHub <noreply@github.com>
Wed, 4 Sep 2024 07:32:55 +0000 (09:32 +0200)
.github/workflows/release.yml
Dockerfile

index 6e1f381c1bff6edade009b5fa897c3751599205b..6bcc571ea88668aaebc0c41ecefcc38640b7bfcc 100644 (file)
@@ -77,8 +77,7 @@ jobs:
   pypi-publish:
     runs-on: ubuntu-latest
     if: ${{ ! inputs.tags }}
-    needs:
-      - build-artifact
+    needs: build-artifact
     steps:
       - name: Retrieve release distributions
         uses: actions/download-artifact@v4
@@ -98,18 +97,15 @@ jobs:
     runs-on: ubuntu-latest
     permissions:
       packages: write
-    needs: build-artifact
+    needs: 
+      - build-artifact
+      - pypi-publish
+    if: |
+      always() &&
+      ((github.event.release.prerelease == false && needs.pypi-publish.result == 'success') || 
+      (github.event.release.prerelease == true && needs.pypi-publish.result == 'skipped') ||
+      (inputs.tags && needs.pypi-publish.result == 'skipped'))
     steps:
-      - name: Retrieve release distributions
-        uses: actions/download-artifact@v4
-        with:
-          name: release-dists
-          path: dist/
-      - name: Copy Wheel to new location
-        shell: bash
-        run: |
-          mkdir -p pre_built_whl
-          cp dist/*.whl pre_built_whl/ 
       - uses: actions/checkout@v4.1.4
       - name: Download Widevine CDM client files from private repository
         shell: bash
@@ -119,6 +115,11 @@ jobs:
           mkdir -p widevine_cdm && cd widevine_cdm
           curl -OJ -H "Authorization: token ${TOKEN}" https://raw.githubusercontent.com/music-assistant/appvars/main/widevine_cdm_client/private_key.pem
           curl -OJ -H "Authorization: token ${TOKEN}" https://raw.githubusercontent.com/music-assistant/appvars/main/widevine_cdm_client/client_id.bin
+      - name: Retrieve release distributions
+        uses: actions/download-artifact@v4
+        with:
+          name: release-dists
+          path: dist/
       - name: Log in to the GitHub container registry
         uses: docker/login-action@v3.3.0
         with:
@@ -175,8 +176,6 @@ jobs:
           push: true
           build-args: |
             MASS_VERSION=${{ needs.build-artifact.outputs.version }}
-            DEV_RELEASE="true"
-            MASS_INSTALL_LOCATION="/tmp/music_assistant-${{ needs.build-artifact.outputs.version }}-py3-none-any.whl"
 
   release-notes-update:
     name: Updates the release notes and changelog
index 075432281ebe2b92303698b55286e058e2321bce..0fde4109631de149522289b04ab37b2c939d43e6 100644 (file)
@@ -4,8 +4,6 @@ FROM python:3.12-alpine3.20
 
 ARG MASS_VERSION
 ARG TARGETPLATFORM
-ARG DEV_RELEASE="false"
-ARG MASS_INSTALL_LOCATION="music-assistant[server]==${MASS_VERSION}"
 
 RUN set -x \
     && apk add --no-cache \
@@ -29,9 +27,6 @@ RUN set -x \
 # Copy widevine client files to container
 RUN mkdir -p /usr/local/bin/widevine_cdm
 COPY widevine_cdm/* /usr/local/bin/widevine_cdm/
-COPY pre_built_whl/music_assistant-${MASS_VERSION}-py3-none-any.whl /tmp/
-
-RUN bash -c 'if [ "${DEV_RELEASE}" = "false" ]; then rm /tmp/music_assistant-${MASS_VERSION}-py3-none-any.whl; fi'
 
 # Upgrade pip + Install uv
 RUN pip install --upgrade pip \
@@ -42,7 +37,7 @@ RUN uv pip install \
     --system \
     --no-cache \
     --find-links "https://wheels.home-assistant.io/musllinux/" \
-    ${MASS_INSTALL_LOCATION}
+    dist/music_assistant-${MASS_VERSION}-py3-none-any.whl
 
 # Configure runtime environmental variables
 ENV LD_PRELOAD="/usr/lib/libjemalloc.so.2"