Skip to content

Commit c4724b3

Browse files
committed
build: functions: another cache test fix
1 parent 2091a6e commit c4724b3

2 files changed

Lines changed: 18 additions & 5 deletions

File tree

.github/workflows/build-openwrt.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,13 @@ jobs:
380380
chmod +x "$GITHUB_WORKSPACE"/scripts/$FUNCTIONS_SH
381381
source "$GITHUB_WORKSPACE"/scripts/$FUNCTIONS_SH
382382
SMART_CHMOD
383+
### ----------------------------------------------------------------- ###
384+
- name: Cache Key Get/Check
385+
working-directory: '/workdir/openwrt'
386+
run: |
387+
chmod +x "$GITHUB_WORKSPACE"/scripts/$FUNCTIONS_SH
388+
source "$GITHUB_WORKSPACE"/scripts/$FUNCTIONS_SH
389+
CACHE_DEPENDENCY
383390
### ----------------------------------------------------------------- ###
384391
- name: Cache Acceleration (Secondary compilation of the same model with the same source code is valid within 7 days, and only one source code cache is retained each time)
385392
uses: DevOpenWRT-Router/Cache-OpenWRT-Builds@main

scripts/functions.sh

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -173,11 +173,17 @@ CACHE_DIRECTORY_SETUP() {
173173
}
174174

175175
CACHE_DEPENDENCY() {
176-
cache_toolchain=$('git log --pretty=tformat:"%h" -n1 tools toolchain')
177-
cache_feeds=$('git log --pretty=tformat:"%h" -n1 feeds')
178-
cache_package=$('git log --pretty=tformat:"%h" -n1 package')
179-
cache_target=$('git log --pretty=tformat:"%h" -n1 target')
180-
cache_staging_dir=$('git log --pretty=tformat:"%h" -n1 staging_dir')
176+
export cache_toolchain=$('git log --pretty=tformat:"%h" -n1 tools toolchain')
177+
export cache_feeds=$('git log --pretty=tformat:"%h" -n1 feeds')
178+
export cache_package=$('git log --pretty=tformat:"%h" -n1 package')
179+
export cache_target=$('git log --pretty=tformat:"%h" -n1 target')
180+
export cache_staging_dir=$('git log --pretty=tformat:"%h" -n1 staging_dir')
181+
182+
echo "$cache_toolchain" >>"$GITHUB_ENV"
183+
echo "$cache_feeds" >>"$GITHUB_ENV"
184+
echo "$cache_package" >>"$GITHUB_ENV"
185+
echo "$cache_target" >>"$GITHUB_ENV"
186+
echo "$cache_staging_dir" >>"$GITHUB_ENV"
181187

182188
}
183189

0 commit comments

Comments
 (0)