mirror of
https://github.com/awalsh128/cache-apt-pkgs-action.git
synced 2024-12-22 18:55:30 +00:00
Sync dev to master. (#93)
* Address block style package issue #84 #88 * Use cache key for upload artifact name #89. * Sync master back to dev. (#92) * Fix if condition for upload-logs step (#87) Previously the if condition was always evaluating to a truthy string (e.g. 'false == "true"' or 'true == "true"') as the string comparison (`== 'true'`) was not inside the expression syntax (`${{ }}`) and thus being treated as a string rather than being evaluated. * Introduce a force update value for reloading cache #82 --------- Co-authored-by: Leroy Hopson <github@leroy.geek.nz> --------- Co-authored-by: Leroy Hopson <github@leroy.geek.nz>
This commit is contained in:
parent
e649dfdfe5
commit
622a4c5687
28
action.yml
28
action.yml
|
@ -45,12 +45,17 @@ runs:
|
||||||
run: |
|
run: |
|
||||||
${GITHUB_ACTION_PATH}/pre_cache_action.sh \
|
${GITHUB_ACTION_PATH}/pre_cache_action.sh \
|
||||||
~/cache-apt-pkgs \
|
~/cache-apt-pkgs \
|
||||||
"${{ inputs.version }}" \
|
"$VERSION" \
|
||||||
"${{ inputs.execute_install_scripts }}" \
|
"$EXEC_INSTALL_SCRIPTS" \
|
||||||
"${{ inputs.debug }}" \
|
"$DEBUG" \
|
||||||
${{ inputs.packages }}
|
"$PACKAGES"
|
||||||
echo "CACHE_KEY=$(cat ~/cache-apt-pkgs/cache_key.md5)" >> $GITHUB_ENV
|
echo "CACHE_KEY=$(cat ~/cache-apt-pkgs/cache_key.md5)" >> $GITHUB_ENV
|
||||||
shell: bash
|
shell: bash
|
||||||
|
env:
|
||||||
|
VERSION: "${{ inputs.version }}"
|
||||||
|
EXEC_INSTALL_SCRIPTS: "${{ inputs.execute_install_scripts }}"
|
||||||
|
DEBUG: "${{ inputs.debug }}"
|
||||||
|
PACKAGES: "${{ inputs.packages }}"
|
||||||
|
|
||||||
- id: load-cache
|
- id: load-cache
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
|
@ -63,18 +68,23 @@ runs:
|
||||||
${GITHUB_ACTION_PATH}/post_cache_action.sh \
|
${GITHUB_ACTION_PATH}/post_cache_action.sh \
|
||||||
~/cache-apt-pkgs \
|
~/cache-apt-pkgs \
|
||||||
/ \
|
/ \
|
||||||
"${{ steps.load-cache.outputs.cache-hit }}" \
|
"$CACHE_HIT" \
|
||||||
"${{ inputs.execute_install_scripts }}" \
|
"$EXEC_INSTALL_SCRIPTS" \
|
||||||
"${{ inputs.debug }}" \
|
"$DEBUG" \
|
||||||
${{ inputs.packages }}
|
"$PACKAGES"
|
||||||
function create_list { local list=$(cat ~/cache-apt-pkgs/manifest_${1}.log | tr '\n' ','); echo ${list:0:-1}; };
|
function create_list { local list=$(cat ~/cache-apt-pkgs/manifest_${1}.log | tr '\n' ','); echo ${list:0:-1}; };
|
||||||
echo "package-version-list=$(create_list main)" >> $GITHUB_OUTPUT
|
echo "package-version-list=$(create_list main)" >> $GITHUB_OUTPUT
|
||||||
echo "all-package-version-list=$(create_list all)" >> $GITHUB_OUTPUT
|
echo "all-package-version-list=$(create_list all)" >> $GITHUB_OUTPUT
|
||||||
shell: bash
|
shell: bash
|
||||||
|
env:
|
||||||
|
CACHE_HIT: "${{ steps.load-cache.outputs.cache-hit }}"
|
||||||
|
EXEC_INSTALL_SCRIPTS: "${{ inputs.execute_install_scripts }}"
|
||||||
|
DEBUG: "${{ inputs.debug }}"
|
||||||
|
PACKAGES: "${{ inputs.packages }}"
|
||||||
|
|
||||||
- id: upload-logs
|
- id: upload-logs
|
||||||
if: ${{ inputs.debug == 'true' }}
|
if: ${{ inputs.debug == 'true' }}
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: cache-apt-pkgs-logs%${{ inputs.packages }}%${{ inputs.version }}
|
name: cache-apt-pkgs-logs_${{ env.CACHE_KEY }}
|
||||||
path: ~/cache-apt-pkgs/*.log
|
path: ~/cache-apt-pkgs/*.log
|
||||||
|
|
Loading…
Reference in a new issue