From 930f2d799e001259b63be29a4ebaf0fc10f09a46 Mon Sep 17 00:00:00 2001 From: Jozef Kruszynski <60214390+jozefKruszynski@users.noreply.github.com> Date: Wed, 4 Sep 2024 09:32:55 +0200 Subject: [PATCH] =?utf8?q?fix:=20=F0=9F=90=9B=20move=20download=20to=20aft?= =?utf8?q?er=20checkout,=20fix=20conditionals=20(#1645)?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 29 ++++++++++++++--------------- Dockerfile | 7 +------ 2 files changed, 15 insertions(+), 21 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6e1f381c..6bcc571e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 diff --git a/Dockerfile b/Dockerfile index 07543228..0fde4109 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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" -- 2.34.1