Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/autobuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/bump-dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down Expand Up @@ -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
Expand Down
47 changes: 22 additions & 25 deletions mac/deploy_mac.sh
Original file line number Diff line number Diff line change
@@ -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"
Expand Down Expand Up @@ -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}"
Copy link
Copy Markdown
Member Author

@ann0see ann0see Aug 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed this to use the version instead of the tag here...


# Build installer image

Expand Down Expand Up @@ -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
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes the function somewhat not portable.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But this code doesn't need to be portable to a non-Mac. And I assume all Macs will have sudo?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. All Macs should have sudo. I just want to make clear that dependencies which don't need make install would need a different function

popd
}

Expand Down
Loading