Skip to content

Commit 157cc00

Browse files
committed
Switch create-dmg to github download
1 parent 4992d47 commit 157cc00

File tree

3 files changed

+28
-28
lines changed

3 files changed

+28
-28
lines changed

.github/workflows/autobuild.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ jobs:
322322
with:
323323
path: |
324324
~/qt
325-
~/Library/Cache/jamulus-homebrew-bottles
325+
~/Library/Cache/jamulus-dependencies
326326
key: ${{ matrix.config.target_os }}-${{ hashFiles('.github/workflows/autobuild.yml', '.github/autobuild/mac.sh', 'mac/deploy_mac.sh') }}-${{ matrix.config.base_command }}
327327

328328
- name: Cache Windows dependencies

.github/workflows/bump-dependencies.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,10 @@ jobs:
4141
get_upstream_version: GH_REPO=miurahr/aqtinstall gh release view --json tagName --jq .tagName | sed -re 's/^v//'
4242
# The following regexps capture both the *nix and the Windows variable syntax (different case, underscore):
4343
local_version_regex: (.*AQTINSTALL_?VERSION\s*=\s*"?)([0-9.]*)("?.*)
44-
44+
- name: create-dmg
45+
changelog_name: create-dmg (macOS)
46+
get_upstream_version: GH_REPO=create-dmg/create-dmg gh release view --json tagName --jq .tagName | sed -re 's/^v//'
47+
local_version_regex: (.*CREATEDMG_VERSION\s*=\s*"?)([0-9.]*)("?.*)
4548
- name: Qt6
4649
changelog_name: bundled Qt6
4750
get_upstream_version: |
@@ -88,7 +91,7 @@ jobs:
8891
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8992
run: |
9093
set -eu
91-
files=( .github/{autobuild,workflows}/* windows/*.ps1 )
94+
files=( .github/{autobuild,workflows}/* windows/*.ps1 mac/*.sh )
9295
upstream_version="$(${{ matrix.components.get_upstream_version }})"
9396
local_version="$(perl -nle 'print "$2" if /${{ matrix.components.local_version_regex }}/i' "${files[@]}" | sort --reverse --version-sort | head -n1)"
9497
if [[ -z "$upstream_version" ]]; then

mac/deploy_mac.sh

Lines changed: 22 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
#!/bin/bash
22
set -eu -o pipefail
33

4+
# Dependency versions
5+
CREATEDMG_VERSION="1.2.2"
6+
47
root_path=$(pwd)
58
project_path="${root_path}/Jamulus.pro"
69
resources_path="${root_path}/src/res"
@@ -138,12 +141,8 @@ build_installer_image() {
138141
local client_target_name="${1}"
139142
local server_target_name="${2}"
140143

141-
# Install create-dmg via brew. brew needs to be installed first.
142-
# Download and later install. This is done to make caching possible
143-
# brew_install_pinned "create-dmg" "1.1.0"
144-
145-
# FIXME: Currently caching is disabled due to an error in the extract step
146-
brew install create-dmg
144+
# Install create-dmg
145+
github_install_dependency "create-dmg/create-dmg" "v${CREATEDMG_VERSION}"
147146

148147
# Build installer image
149148

@@ -193,26 +192,24 @@ build_storesign_pkg() {
193192
# 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"
194193
}
195194

196-
brew_install_pinned() {
197-
local pkg="$1"
198-
local version="$2"
199-
local pkg_version="${pkg}@${version}"
200-
local brew_bottle_dir="${HOME}/Library/Cache/jamulus-homebrew-bottles"
201-
local formula="/usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask/Formula/${pkg_version}.rb"
202-
echo "Installing ${pkg_version}"
203-
mkdir -p "${brew_bottle_dir}"
204-
pushd "${brew_bottle_dir}"
205-
if ! find . | grep -qF "${pkg_version}--"; then
206-
echo "Building fresh ${pkg_version} package"
207-
brew developer on # avoids a warning
208-
brew extract --version="${version}" "${pkg}" homebrew/cask
209-
brew install --build-bottle --formula "${formula}"
210-
brew bottle "${formula}"
211-
# In order to keep the result the same, we uninstall and re-install without --build-bottle later
212-
# (--build-bottle is documented to change behavior, e.g. by not running postinst scripts).
213-
brew uninstall "${pkg_version}"
195+
github_install_dependency() {
196+
local repository="${1}"
197+
local version="${2}"
198+
dependency_root_folder="${HOME}/Library/Cache/jamulus-dependencies/${repository}/${version}"
199+
if [[ ! -d "${dependency_root_folder}" ]]; then
200+
TMPDOWNLOADDIR=$(mktemp -d '/tmp/ghdep.XXXXXX')
201+
# Download release
202+
mkdir -p "${dependency_root_folder}"
203+
wget "https://github.com/${repository}/archive/refs/tags/${version}.tar.gz" -O "${TMPDOWNLOADDIR}/dep.tar.gz"
204+
205+
# Unpack release and clean up
206+
tar -xvzf "${TMPDOWNLOADDIR}/dep.tar.gz" -C "${TMPDOWNLOADDIR}/"
207+
rm "${TMPDOWNLOADDIR}/dep.tar.gz"
208+
# Since github creates a folder with the version number in the tar, copy all contents from this folder into ${dependency_root_folder}
209+
mv "${TMPDOWNLOADDIR}"/*/* "${dependency_root_folder}/"
214210
fi
215-
brew install "${pkg_version}--"*
211+
pushd "${dependency_root_folder}"
212+
sudo make install
216213
popd
217214
}
218215

0 commit comments

Comments
 (0)