Remote cache is very useful to sync pods among developer machines & build machines, but there is a problem when we needs various cache.
Swift versions can be various(like 5.3.1 & 5.4), Pod composition or prebuild setup can be various between master and other branches. That's why we needs diversified remote caches for seamless adoption of this library for multi environment and machines.
actions/cache in GitHub Actions support this feature with key like below and it's useful.
With this change, user programmers can cache specific state with composited key with hash value like PODFILE CHECKSUM in Podfile.lock which is used for remote branch name like below:
# Makefile
# Mostly for build machine
project:
make xcodegen_generate
make pod_install
# For daily development for developer
project_fast:
make xcodegen_generate
bundle exec pod install
...
podfile_lock_checksum:
@echo `grep "PODFILE CHECKSUM: " Podfile.lock | awk '{print $$3}'`
# Need to execute on Podfile changes
# Branch name would be 'swift5.4-PODFILE_CHECKSUM'
pod_install:
bundle exec pod binary prebuild "swift$$(make swift_version)-$$(make podfile_lock_checksum)" --no-fetch # Previous CHECKSUM
bundle exec pod binary fetch "swift$$(make swift_version)-$$(make podfile_lock_checksum)" # Needs to create new branch if needed (I found `pod binary fetch` handle this)
bundle exec pod binary push "swift$$(make swift_version)-$$(make podfile_lock_checksum)" # with new CHECKSUM if it is changed after prebuild
...
Changes
Can clone with branch name which doesn't exist on remote origin
Can fetch with branch name which doesn't exist on remote origin
Can push cache with new branch (composited name with swift version or changed CHECKSUM)
Create new branch before commit & push when the new cache will be pushed
Checklist
bundle exec rspec
from the root directory to run my changes against rspec testsbundle exec rubocop
to check code styleDescription
(Related Issue : https://github.com/grab/cocoapods-binary-cache/issues/46)
Remote cache is very useful to sync pods among developer machines & build machines, but there is a problem when we needs various cache.
Swift versions can be various(like 5.3.1 & 5.4), Pod composition or prebuild setup can be various between master and other branches. That's why we needs diversified remote caches for seamless adoption of this library for multi environment and machines.
actions/cache
inGitHub Actions
support this feature withkey
like below and it's useful.With this change, user programmers can cache specific state with composited key with hash value like
PODFILE CHECKSUM
inPodfile.lock
which is used for remote branch name like below:Changes