From 157cc009e0386ff4b2cb65f4a9acc4471d2c1676 Mon Sep 17 00:00:00 2001 From: ann0see <20726856+ann0see@users.noreply.github.com> Date: Sun, 3 Aug 2025 10:53:30 +0200 Subject: [PATCH] Switch create-dmg to github download --- .github/workflows/autobuild.yml | 2 +- .github/workflows/bump-dependencies.yml | 7 ++-- mac/deploy_mac.sh | 47 ++++++++++++------------- 3 files changed, 28 insertions(+), 28 deletions(-) diff --git a/.github/workflows/autobuild.yml b/.github/workflows/autobuild.yml index 94f38e570e..82d9786a5e 100644 --- a/.github/workflows/autobuild.yml +++ b/.github/workflows/autobuild.yml @@ -322,7 +322,7 @@ jobs: with: path: | ~/qt - ~/Library/Cache/jamulus-homebrew-bottles + ~/Library/Cache/jamulus-dependencies key: ${{ matrix.config.target_os }}-${{ hashFiles('.github/workflows/autobuild.yml', '.github/autobuild/mac.sh', 'mac/deploy_mac.sh') }}-${{ matrix.config.base_command }} - name: Cache Windows dependencies diff --git a/.github/workflows/bump-dependencies.yml b/.github/workflows/bump-dependencies.yml index 831f98e857..017257ce56 100644 --- a/.github/workflows/bump-dependencies.yml +++ b/.github/workflows/bump-dependencies.yml @@ -41,7 +41,10 @@ jobs: get_upstream_version: GH_REPO=miurahr/aqtinstall gh release view --json tagName --jq .tagName | sed -re 's/^v//' # The following regexps capture both the *nix and the Windows variable syntax (different case, underscore): local_version_regex: (.*AQTINSTALL_?VERSION\s*=\s*"?)([0-9.]*)("?.*) - + - name: create-dmg + changelog_name: create-dmg (macOS) + get_upstream_version: GH_REPO=create-dmg/create-dmg gh release view --json tagName --jq .tagName | sed -re 's/^v//' + local_version_regex: (.*CREATEDMG_VERSION\s*=\s*"?)([0-9.]*)("?.*) - name: Qt6 changelog_name: bundled Qt6 get_upstream_version: | @@ -88,7 +91,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | set -eu - files=( .github/{autobuild,workflows}/* windows/*.ps1 ) + files=( .github/{autobuild,workflows}/* windows/*.ps1 mac/*.sh ) upstream_version="$(${{ matrix.components.get_upstream_version }})" local_version="$(perl -nle 'print "$2" if /${{ matrix.components.local_version_regex }}/i' "${files[@]}" | sort --reverse --version-sort | head -n1)" if [[ -z "$upstream_version" ]]; then diff --git a/mac/deploy_mac.sh b/mac/deploy_mac.sh index 9fb96be95c..cfe138b92c 100755 --- a/mac/deploy_mac.sh +++ b/mac/deploy_mac.sh @@ -1,6 +1,9 @@ #!/bin/bash set -eu -o pipefail +# Dependency versions +CREATEDMG_VERSION="1.2.2" + root_path=$(pwd) project_path="${root_path}/Jamulus.pro" resources_path="${root_path}/src/res" @@ -138,12 +141,8 @@ build_installer_image() { local client_target_name="${1}" local server_target_name="${2}" - # Install create-dmg via brew. brew needs to be installed first. - # Download and later install. This is done to make caching possible - # brew_install_pinned "create-dmg" "1.1.0" - - # FIXME: Currently caching is disabled due to an error in the extract step - brew install create-dmg + # Install create-dmg + github_install_dependency "create-dmg/create-dmg" "v${CREATEDMG_VERSION}" # Build installer image @@ -193,26 +192,24 @@ build_storesign_pkg() { # productbuild --sign "${macinst_cert_name}" --keychain build.keychain --component "${macapp_deploy_path}/${server_target_name}.app" /Applications "${deploy_path}/${server_target_name}_${JAMULUS_BUILD_VERSION}.pkg" } -brew_install_pinned() { - local pkg="$1" - local version="$2" - local pkg_version="${pkg}@${version}" - local brew_bottle_dir="${HOME}/Library/Cache/jamulus-homebrew-bottles" - local formula="/usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask/Formula/${pkg_version}.rb" - echo "Installing ${pkg_version}" - mkdir -p "${brew_bottle_dir}" - pushd "${brew_bottle_dir}" - if ! find . | grep -qF "${pkg_version}--"; then - echo "Building fresh ${pkg_version} package" - brew developer on # avoids a warning - brew extract --version="${version}" "${pkg}" homebrew/cask - brew install --build-bottle --formula "${formula}" - brew bottle "${formula}" - # In order to keep the result the same, we uninstall and re-install without --build-bottle later - # (--build-bottle is documented to change behavior, e.g. by not running postinst scripts). - brew uninstall "${pkg_version}" +github_install_dependency() { + local repository="${1}" + local version="${2}" + dependency_root_folder="${HOME}/Library/Cache/jamulus-dependencies/${repository}/${version}" + if [[ ! -d "${dependency_root_folder}" ]]; then + TMPDOWNLOADDIR=$(mktemp -d '/tmp/ghdep.XXXXXX') + # Download release + mkdir -p "${dependency_root_folder}" + wget "https://github.com/${repository}/archive/refs/tags/${version}.tar.gz" -O "${TMPDOWNLOADDIR}/dep.tar.gz" + + # Unpack release and clean up + tar -xvzf "${TMPDOWNLOADDIR}/dep.tar.gz" -C "${TMPDOWNLOADDIR}/" + rm "${TMPDOWNLOADDIR}/dep.tar.gz" + # Since github creates a folder with the version number in the tar, copy all contents from this folder into ${dependency_root_folder} + mv "${TMPDOWNLOADDIR}"/*/* "${dependency_root_folder}/" fi - brew install "${pkg_version}--"* + pushd "${dependency_root_folder}" + sudo make install popd }