Files
runner-images/images/ubuntu/scripts/build/install-actions-cache.sh
T

25 lines
1.2 KiB
Bash
Raw Normal View History

2023-10-11 13:31:13 -04:00
#!/bin/bash -e
################################################################################
2023-11-22 21:49:23 +01:00
## File: install-actions-cache.sh
## Desc: Download latest release from https://github.com/actions/action-versions
2023-10-11 13:31:13 -04:00
## Maintainer: #actions-runtime and @TingluoHuang
################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/install.sh
source $HELPER_SCRIPTS/etc-environment.sh
# Prepare directory and env variable for ACTIONS_RUNNER_ACTION_ARCHIVE_CACHE
ACTION_ARCHIVE_CACHE_DIR=/opt/actionarchivecache
mkdir -p $ACTION_ARCHIVE_CACHE_DIR
chmod -R 777 $ACTION_ARCHIVE_CACHE_DIR
echo "Setting up ACTIONS_RUNNER_ACTION_ARCHIVE_CACHE variable to ${ACTION_ARCHIVE_CACHE_DIR}"
2023-12-26 12:50:52 +01:00
set_etc_environment_variable "ACTIONS_RUNNER_ACTION_ARCHIVE_CACHE" "${ACTION_ARCHIVE_CACHE_DIR}"
2023-10-11 13:31:13 -04:00
# Download latest release from github.com/actions/action-versions and untar to /opt/actionarchivecache
2023-12-29 12:36:27 +01:00
download_url=$(resolve_github_release_asset_url "actions/action-versions" "endswith(\"action-versions.tar.gz\")" "latest")
archive_path=$(download_with_retry "$download_url")
tar -xzf "$archive_path" -C $ACTION_ARCHIVE_CACHE_DIR
2023-10-11 13:31:13 -04:00
invoke_tests "ActionArchiveCache"