From 5df381b19bce913f5c780054ad628ad66b6ee7e4 Mon Sep 17 00:00:00 2001 From: w311ang <30381083+w311ang@users.noreply.github.com> Date: Thu, 28 Jul 2022 02:06:49 +0800 Subject: [PATCH 01/39] Update action.yml --- action.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/action.yml b/action.yml index 1cafa3a5..8088ee1a 100644 --- a/action.yml +++ b/action.yml @@ -21,6 +21,10 @@ inputs: description: 'path prefix to openwrt build directory' required: false defalut: '' + branch: + description: 'the current branch of the building' + required: false + defalut: ${GITHUB_REF#refs/heads/} outputs: hit: description: 'indicate cache found' From 245443e778139942b7773ec547f049e548cabb1c Mon Sep 17 00:00:00 2001 From: w311ang <30381083+w311ang@users.noreply.github.com> Date: Thu, 28 Jul 2022 02:08:02 +0800 Subject: [PATCH 02/39] Update fetch.js --- fetch.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fetch.js b/fetch.js index e562cdea..ed1eba2b 100644 --- a/fetch.js +++ b/fetch.js @@ -9,6 +9,7 @@ try { const prefix = core.getInput('prefix'); if ( prefix != '' ){ process.chdir(prefix); + const branch = core.getInput('branch'); } const toolchain = core.getInput('toolchain'); @@ -29,7 +30,7 @@ try { if ( ccache == 'true' ){ stdout = execSync('date +%s').toString().trim(); restoreKeys.unshift(keyString); - keyString = keyString+'-'+stdout; + keyString = keyString+'-'+branch+'-'+stdout; paths.push('.ccache'); } From 242a1b5c444388ea67b63c7e36a085e6527ea772 Mon Sep 17 00:00:00 2001 From: w311ang <30381083+w311ang@users.noreply.github.com> Date: Thu, 28 Jul 2022 02:09:04 +0800 Subject: [PATCH 03/39] Update fetch.js --- fetch.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fetch.js b/fetch.js index ed1eba2b..dd307d09 100644 --- a/fetch.js +++ b/fetch.js @@ -17,7 +17,7 @@ try { if ( toolchain == 'true' ){ stdout = execSync('git log --pretty=tformat:"%h" -n1 tools toolchain').toString().trim(); restoreKeys.unshift(keyString); - keyString = keyString+'-'+stdout; + keyString = keyString+'-'+branch+'-'+stdout; paths.push('staging_dir/host*'); paths.push('staging_dir/tool*'); paths.push('build_dir/host*'); From b68d37cf4fb88028ada178915658bf405ae287f7 Mon Sep 17 00:00:00 2001 From: w311ang <30381083+w311ang@users.noreply.github.com> Date: Thu, 28 Jul 2022 02:10:18 +0800 Subject: [PATCH 04/39] Update save.js --- save.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/save.js b/save.js index 4d96410f..bdbeabb4 100644 --- a/save.js +++ b/save.js @@ -8,12 +8,13 @@ try { const prefix = core.getInput('prefix'); if ( prefix != '' ){ process.chdir(prefix); + const branch = core.getInput('branch'); } const toolchain = core.getInput('toolchain'); if ( toolchain=='true' ){ stdout=execSync('git log --pretty=tformat:"%h" -n1 tools toolchain').toString().trim(); - keyString=keyString+'-'+stdout; + keyString=keyString+'-'+branch+'-'+stdout; paths.push('staging_dir/host*'); paths.push('staging_dir/tool*'); paths.push('build_dir/host*'); @@ -23,7 +24,7 @@ try { const ccache = core.getInput('ccache'); if ( ccache=='true' ){ stdout=execSync('date +%s').toString().trim(); - keyString=keyString+'-'+stdout; + keyString=keyString+'-'+branch+'-'+stdout; paths.push('.ccache'); } From e92a32a54f6afde90aa7a31681bf34c851d384c6 Mon Sep 17 00:00:00 2001 From: w311ang <30381083+w311ang@users.noreply.github.com> Date: Thu, 28 Jul 2022 10:23:35 +0800 Subject: [PATCH 05/39] Update action.yml --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 8088ee1a..f6c3ec1e 100644 --- a/action.yml +++ b/action.yml @@ -24,7 +24,7 @@ inputs: branch: description: 'the current branch of the building' required: false - defalut: ${GITHUB_REF#refs/heads/} + defalut: '${GITHUB_REF#refs/heads/}' outputs: hit: description: 'indicate cache found' From 484619a8b77585a0a32b37e7f012e2236d7c9506 Mon Sep 17 00:00:00 2001 From: w311ang <30381083+w311ang@users.noreply.github.com> Date: Thu, 28 Jul 2022 11:17:19 +0800 Subject: [PATCH 06/39] Update fetch.js --- fetch.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fetch.js b/fetch.js index dd307d09..68465f99 100644 --- a/fetch.js +++ b/fetch.js @@ -7,9 +7,9 @@ try { var keyString = 'cache-openwrt'; var restoreKeys = new Array(); const prefix = core.getInput('prefix'); + const branch = core.getInput('branch'); if ( prefix != '' ){ process.chdir(prefix); - const branch = core.getInput('branch'); } const toolchain = core.getInput('toolchain'); From 3f96cbf35a22045bb401a454ed1087bf2db2ec54 Mon Sep 17 00:00:00 2001 From: w311ang <30381083+w311ang@users.noreply.github.com> Date: Thu, 28 Jul 2022 11:17:44 +0800 Subject: [PATCH 07/39] Update save.js --- save.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/save.js b/save.js index bdbeabb4..5dbaae4f 100644 --- a/save.js +++ b/save.js @@ -6,9 +6,9 @@ try { var paths = new Array(); var keyString = 'cache-openwrt'; const prefix = core.getInput('prefix'); + const branch = core.getInput('branch'); if ( prefix != '' ){ process.chdir(prefix); - const branch = core.getInput('branch'); } const toolchain = core.getInput('toolchain'); From f628fbccb5b6956f8a6c8a57911f8a3b063d3203 Mon Sep 17 00:00:00 2001 From: w311ang <30381083+w311ang@users.noreply.github.com> Date: Thu, 28 Jul 2022 12:02:33 +0800 Subject: [PATCH 08/39] Create test.yml --- .github/workflows/test.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..ace65eb6 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,19 @@ +name: Test + +on: + push: + paths-ignore: + - 'README.md' + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Make openwrt directory + run: mkdir openwrt + - name: cache + uses: w311ang/cachewrtbuild@main + with: + ccache: true + prefix: ${{ github.workspace }}/openwrt From 1590fe23b82eb11c560168e8cc9cffeeaf17b912 Mon Sep 17 00:00:00 2001 From: w311ang <30381083+w311ang@users.noreply.github.com> Date: Thu, 28 Jul 2022 12:18:38 +0800 Subject: [PATCH 09/39] Update test.yml --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ace65eb6..84af4e1f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Make openwrt directory - run: mkdir openwrt + run: git clone https://github.com/coolsnowwolf/lede.git openwrt - name: cache uses: w311ang/cachewrtbuild@main with: From 89743801bf079e99efb5b68106a2dbc0391b6d20 Mon Sep 17 00:00:00 2001 From: w311ang <30381083+w311ang@users.noreply.github.com> Date: Thu, 28 Jul 2022 12:19:52 +0800 Subject: [PATCH 10/39] Update action.yml --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index f6c3ec1e..6eda6b73 100644 --- a/action.yml +++ b/action.yml @@ -24,7 +24,7 @@ inputs: branch: description: 'the current branch of the building' required: false - defalut: '${GITHUB_REF#refs/heads/}' + defalut: '${GITHUB_REF}' outputs: hit: description: 'indicate cache found' From f0b168b846f9dbffbd4bf284f99bc3e8b83441ba Mon Sep 17 00:00:00 2001 From: w311ang <30381083+w311ang@users.noreply.github.com> Date: Thu, 28 Jul 2022 12:24:20 +0800 Subject: [PATCH 11/39] Update test.yml --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 84af4e1f..8ad58047 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,6 +10,7 @@ jobs: build: runs-on: ubuntu-latest steps: + - run: echo ${GITHUB_REF} - name: Make openwrt directory run: git clone https://github.com/coolsnowwolf/lede.git openwrt - name: cache From d6f5f9593732e0387ae82171432521077249d48b Mon Sep 17 00:00:00 2001 From: w311ang <30381083+w311ang@users.noreply.github.com> Date: Thu, 28 Jul 2022 12:34:07 +0800 Subject: [PATCH 12/39] Update action.yml --- action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/action.yml b/action.yml index 6eda6b73..3ae6ec1b 100644 --- a/action.yml +++ b/action.yml @@ -23,8 +23,8 @@ inputs: defalut: '' branch: description: 'the current branch of the building' - required: false - defalut: '${GITHUB_REF}' + required: true + defalut: ${GITHUB_REF} outputs: hit: description: 'indicate cache found' From 573db51ac08b3adc6d1449d6a81ec5e0e4369917 Mon Sep 17 00:00:00 2001 From: w311ang <30381083+w311ang@users.noreply.github.com> Date: Thu, 28 Jul 2022 12:38:39 +0800 Subject: [PATCH 13/39] Update action.yml --- action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/action.yml b/action.yml index 3ae6ec1b..d68f6c91 100644 --- a/action.yml +++ b/action.yml @@ -23,8 +23,8 @@ inputs: defalut: '' branch: description: 'the current branch of the building' - required: true - defalut: ${GITHUB_REF} + required: false + defalut: ${{ GITHUB_REF_NAME }} outputs: hit: description: 'indicate cache found' From b06fb335b256ea395decd315cadb8252e82ac452 Mon Sep 17 00:00:00 2001 From: w311ang <30381083+w311ang@users.noreply.github.com> Date: Thu, 28 Jul 2022 12:41:07 +0800 Subject: [PATCH 14/39] Update action.yml --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index d68f6c91..76f13d6a 100644 --- a/action.yml +++ b/action.yml @@ -24,7 +24,7 @@ inputs: branch: description: 'the current branch of the building' required: false - defalut: ${{ GITHUB_REF_NAME }} + defalut: ${{ github.ref_name }} outputs: hit: description: 'indicate cache found' From fa9375d798027b2998439581234d40421f98ecf1 Mon Sep 17 00:00:00 2001 From: w311ang <30381083+w311ang@users.noreply.github.com> Date: Thu, 28 Jul 2022 12:42:02 +0800 Subject: [PATCH 15/39] Update test.yml --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8ad58047..15debd26 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,7 +10,7 @@ jobs: build: runs-on: ubuntu-latest steps: - - run: echo ${GITHUB_REF} + - run: echo ${{ github.ref_name }} - name: Make openwrt directory run: git clone https://github.com/coolsnowwolf/lede.git openwrt - name: cache From 6f5f3e490780efe5640caaf9ae509ca31c37b53a Mon Sep 17 00:00:00 2001 From: w311ang <30381083+w311ang@users.noreply.github.com> Date: Thu, 28 Jul 2022 12:44:43 +0800 Subject: [PATCH 16/39] Update action.yml --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 76f13d6a..4c9ed7aa 100644 --- a/action.yml +++ b/action.yml @@ -23,7 +23,7 @@ inputs: defalut: '' branch: description: 'the current branch of the building' - required: false + required: true defalut: ${{ github.ref_name }} outputs: hit: From 318fb376ade997ab61ce4ce8149f183d6a50154e Mon Sep 17 00:00:00 2001 From: w311ang <30381083+w311ang@users.noreply.github.com> Date: Thu, 28 Jul 2022 12:45:19 +0800 Subject: [PATCH 17/39] Update test.yml --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 15debd26..f640712b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -18,3 +18,4 @@ jobs: with: ccache: true prefix: ${{ github.workspace }}/openwrt + branch: ${{ github.ref_name }} From f054d2e5544d83ed22e7595c3c1108ae1227b33b Mon Sep 17 00:00:00 2001 From: w311ang <30381083+w311ang@users.noreply.github.com> Date: Thu, 28 Jul 2022 12:46:28 +0800 Subject: [PATCH 18/39] Update fetch.js --- fetch.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fetch.js b/fetch.js index 68465f99..85b123f4 100644 --- a/fetch.js +++ b/fetch.js @@ -30,7 +30,7 @@ try { if ( ccache == 'true' ){ stdout = execSync('date +%s').toString().trim(); restoreKeys.unshift(keyString); - keyString = keyString+'-'+branch+'-'+stdout; + keyString = keyString+'-'+stdout; paths.push('.ccache'); } From 55a826ff4ba33ad32aded171d59dbd5b266567e0 Mon Sep 17 00:00:00 2001 From: w311ang <30381083+w311ang@users.noreply.github.com> Date: Thu, 28 Jul 2022 12:46:49 +0800 Subject: [PATCH 19/39] Update save.js --- save.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/save.js b/save.js index 5dbaae4f..ec74bfc4 100644 --- a/save.js +++ b/save.js @@ -24,7 +24,7 @@ try { const ccache = core.getInput('ccache'); if ( ccache=='true' ){ stdout=execSync('date +%s').toString().trim(); - keyString=keyString+'-'+branch+'-'+stdout; + keyString=keyString+'-'+stdout; paths.push('.ccache'); } From 37e7f14dda315d2188a5a97b5ed0f406af890d01 Mon Sep 17 00:00:00 2001 From: w311ang <30381083+w311ang@users.noreply.github.com> Date: Thu, 28 Jul 2022 12:47:40 +0800 Subject: [PATCH 20/39] Update save.js --- save.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/save.js b/save.js index ec74bfc4..a797e947 100644 --- a/save.js +++ b/save.js @@ -4,7 +4,7 @@ const execSync = require('child_process').execSync; try { var paths = new Array(); - var keyString = 'cache-openwrt'; + var keyString = 'cache-openwrt'+'-'+branch; const prefix = core.getInput('prefix'); const branch = core.getInput('branch'); if ( prefix != '' ){ @@ -14,7 +14,7 @@ try { const toolchain = core.getInput('toolchain'); if ( toolchain=='true' ){ stdout=execSync('git log --pretty=tformat:"%h" -n1 tools toolchain').toString().trim(); - keyString=keyString+'-'+branch+'-'+stdout; + keyString=keyString+'-'+stdout; paths.push('staging_dir/host*'); paths.push('staging_dir/tool*'); paths.push('build_dir/host*'); From cb6aecf2b212834e662dbf9224bfc42c32281ebe Mon Sep 17 00:00:00 2001 From: w311ang <30381083+w311ang@users.noreply.github.com> Date: Thu, 28 Jul 2022 12:48:20 +0800 Subject: [PATCH 21/39] Update fetch.js --- fetch.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fetch.js b/fetch.js index 85b123f4..c2fca505 100644 --- a/fetch.js +++ b/fetch.js @@ -4,10 +4,10 @@ const execSync = require('child_process').execSync; try { var paths = new Array(); - var keyString = 'cache-openwrt'; + const branch = core.getInput('branch'); + var keyString = 'cache-openwrt'+'-'+branch; var restoreKeys = new Array(); const prefix = core.getInput('prefix'); - const branch = core.getInput('branch'); if ( prefix != '' ){ process.chdir(prefix); } @@ -17,7 +17,7 @@ try { if ( toolchain == 'true' ){ stdout = execSync('git log --pretty=tformat:"%h" -n1 tools toolchain').toString().trim(); restoreKeys.unshift(keyString); - keyString = keyString+'-'+branch+'-'+stdout; + keyString = keyString+'-'+stdout; paths.push('staging_dir/host*'); paths.push('staging_dir/tool*'); paths.push('build_dir/host*'); From 2970457467cf6bd5ae4ae17395d81233b65c546c Mon Sep 17 00:00:00 2001 From: w311ang <30381083+w311ang@users.noreply.github.com> Date: Thu, 28 Jul 2022 12:48:48 +0800 Subject: [PATCH 22/39] Update save.js --- save.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/save.js b/save.js index a797e947..8deb07a5 100644 --- a/save.js +++ b/save.js @@ -4,9 +4,9 @@ const execSync = require('child_process').execSync; try { var paths = new Array(); + const branch = core.getInput('branch'); var keyString = 'cache-openwrt'+'-'+branch; const prefix = core.getInput('prefix'); - const branch = core.getInput('branch'); if ( prefix != '' ){ process.chdir(prefix); } From a48f825e817337af0663d3c930e073ee0b364bf9 Mon Sep 17 00:00:00 2001 From: w311ang <30381083+w311ang@users.noreply.github.com> Date: Thu, 28 Jul 2022 12:57:46 +0800 Subject: [PATCH 23/39] Update test.yml --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f640712b..21bf1ae9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,7 +14,7 @@ jobs: - name: Make openwrt directory run: git clone https://github.com/coolsnowwolf/lede.git openwrt - name: cache - uses: w311ang/cachewrtbuild@main + uses: w311angg/cachewrtbuild@main with: ccache: true prefix: ${{ github.workspace }}/openwrt From 61189404f35daa48b1ee388f7ff4fb67334e6f76 Mon Sep 17 00:00:00 2001 From: w311ang <30381083+w311ang@users.noreply.github.com> Date: Thu, 28 Jul 2022 13:00:41 +0800 Subject: [PATCH 24/39] Update action.yml --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 4c9ed7aa..ebe4ee3f 100644 --- a/action.yml +++ b/action.yml @@ -24,7 +24,7 @@ inputs: branch: description: 'the current branch of the building' required: true - defalut: ${{ github.ref_name }} + defalut: ${{ env.GITHUB_REF_NAME }} outputs: hit: description: 'indicate cache found' From 9bc74f68475152329a6229798cfee89466200605 Mon Sep 17 00:00:00 2001 From: w311ang <30381083+w311ang@users.noreply.github.com> Date: Thu, 28 Jul 2022 13:06:47 +0800 Subject: [PATCH 25/39] Update fetch.js --- fetch.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fetch.js b/fetch.js index c2fca505..f34f2df4 100644 --- a/fetch.js +++ b/fetch.js @@ -4,7 +4,7 @@ const execSync = require('child_process').execSync; try { var paths = new Array(); - const branch = core.getInput('branch'); + branch = execSync('echo $GITHUB_REF_NAME').toString().trim(); var keyString = 'cache-openwrt'+'-'+branch; var restoreKeys = new Array(); const prefix = core.getInput('prefix'); From 6c820223fd2e26fae58a8bd64de705715512a9a1 Mon Sep 17 00:00:00 2001 From: w311ang <30381083+w311ang@users.noreply.github.com> Date: Thu, 28 Jul 2022 13:07:35 +0800 Subject: [PATCH 26/39] Update action.yml --- action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/action.yml b/action.yml index ebe4ee3f..9a6e6397 100644 --- a/action.yml +++ b/action.yml @@ -23,8 +23,8 @@ inputs: defalut: '' branch: description: 'the current branch of the building' - required: true - defalut: ${{ env.GITHUB_REF_NAME }} + required: false + defalut: '' outputs: hit: description: 'indicate cache found' From 1ac3441781cc1b86c7652a299e2d4b64febbc35f Mon Sep 17 00:00:00 2001 From: w311ang <30381083+w311ang@users.noreply.github.com> Date: Thu, 28 Jul 2022 13:10:56 +0800 Subject: [PATCH 27/39] Update fetch.js --- fetch.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fetch.js b/fetch.js index f34f2df4..8ead6612 100644 --- a/fetch.js +++ b/fetch.js @@ -4,7 +4,7 @@ const execSync = require('child_process').execSync; try { var paths = new Array(); - branch = execSync('echo $GITHUB_REF_NAME').toString().trim(); + branch = process.env.GITHUB_REF_NAME var keyString = 'cache-openwrt'+'-'+branch; var restoreKeys = new Array(); const prefix = core.getInput('prefix'); From c6b6b5c0bfa697e609416adaaa234301eb551f74 Mon Sep 17 00:00:00 2001 From: w311ang <30381083+w311ang@users.noreply.github.com> Date: Thu, 28 Jul 2022 13:12:36 +0800 Subject: [PATCH 28/39] Update action.yml --- action.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/action.yml b/action.yml index 9a6e6397..1cafa3a5 100644 --- a/action.yml +++ b/action.yml @@ -21,10 +21,6 @@ inputs: description: 'path prefix to openwrt build directory' required: false defalut: '' - branch: - description: 'the current branch of the building' - required: false - defalut: '' outputs: hit: description: 'indicate cache found' From 0a0bb1e7d741c566cc7f4a5b220aca99f17ad9b5 Mon Sep 17 00:00:00 2001 From: w311ang <30381083+w311ang@users.noreply.github.com> Date: Thu, 28 Jul 2022 13:14:11 +0800 Subject: [PATCH 29/39] Update fetch.js --- fetch.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fetch.js b/fetch.js index 8ead6612..64a910e0 100644 --- a/fetch.js +++ b/fetch.js @@ -4,7 +4,7 @@ const execSync = require('child_process').execSync; try { var paths = new Array(); - branch = process.env.GITHUB_REF_NAME + const branch = process.env.GITHUB_REF_NAME var keyString = 'cache-openwrt'+'-'+branch; var restoreKeys = new Array(); const prefix = core.getInput('prefix'); From 1ea302c656c13fe904c3a8ca01fd4f42836fdd10 Mon Sep 17 00:00:00 2001 From: w311ang <30381083+w311ang@users.noreply.github.com> Date: Thu, 28 Jul 2022 13:14:32 +0800 Subject: [PATCH 30/39] Update save.js --- save.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/save.js b/save.js index 8deb07a5..fe42ff8f 100644 --- a/save.js +++ b/save.js @@ -4,7 +4,7 @@ const execSync = require('child_process').execSync; try { var paths = new Array(); - const branch = core.getInput('branch'); + const branch = process.env.GITHUB_REF_NAME var keyString = 'cache-openwrt'+'-'+branch; const prefix = core.getInput('prefix'); if ( prefix != '' ){ From db813c9d2a29de29071a1d089e39c8330661d44f Mon Sep 17 00:00:00 2001 From: w311ang <30381083+w311ang@users.noreply.github.com> Date: Thu, 28 Jul 2022 13:37:53 +0800 Subject: [PATCH 31/39] Delete test.yml --- .github/workflows/test.yml | 21 --------------------- 1 file changed, 21 deletions(-) delete mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index 21bf1ae9..00000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: Test - -on: - push: - paths-ignore: - - 'README.md' - workflow_dispatch: - -jobs: - build: - runs-on: ubuntu-latest - steps: - - run: echo ${{ github.ref_name }} - - name: Make openwrt directory - run: git clone https://github.com/coolsnowwolf/lede.git openwrt - - name: cache - uses: w311angg/cachewrtbuild@main - with: - ccache: true - prefix: ${{ github.workspace }}/openwrt - branch: ${{ github.ref_name }} From 3de974785cee266ef7636e3feb3739eefe5768d5 Mon Sep 17 00:00:00 2001 From: w311ang <30381083+w311ang@users.noreply.github.com> Date: Thu, 28 Jul 2022 13:43:09 +0800 Subject: [PATCH 32/39] Create pull.yml --- .github/pull.yml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .github/pull.yml diff --git a/.github/pull.yml b/.github/pull.yml new file mode 100644 index 00000000..34ebb6e1 --- /dev/null +++ b/.github/pull.yml @@ -0,0 +1,6 @@ +version: "1" +rules: + - base: main + upstream: klever1988:main # change `wei` to the owner of upstream repo + mergeMethod: merge + autoMerge: false From df771597e82977609d321b0f0cfe761d32e6ba03 Mon Sep 17 00:00:00 2001 From: w311ang <30381083+w311ang@users.noreply.github.com> Date: Thu, 28 Jul 2022 13:51:46 +0800 Subject: [PATCH 33/39] Update fetch.js --- fetch.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/fetch.js b/fetch.js index 64a910e0..ef116f51 100644 --- a/fetch.js +++ b/fetch.js @@ -4,14 +4,17 @@ const execSync = require('child_process').execSync; try { var paths = new Array(); - const branch = process.env.GITHUB_REF_NAME - var keyString = 'cache-openwrt'+'-'+branch; + var keyString = 'cache-openwrt'; var restoreKeys = new Array(); const prefix = core.getInput('prefix'); if ( prefix != '' ){ process.chdir(prefix); } + const branch = process.env.GITHUB_REF_NAME; + restoreKeys.unshift(keyString); + keyString = keyString+'-'+branch; + const toolchain = core.getInput('toolchain'); var skiptoolchain = core.getInput('skip'); if ( toolchain == 'true' ){ From d9ec9b1b57b4858f2b2c714cb2283cf0b1e7fd24 Mon Sep 17 00:00:00 2001 From: w311ang <30381083+w311ang@users.noreply.github.com> Date: Thu, 28 Jul 2022 13:52:20 +0800 Subject: [PATCH 34/39] Update save.js --- save.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/save.js b/save.js index fe42ff8f..10575198 100644 --- a/save.js +++ b/save.js @@ -4,13 +4,16 @@ const execSync = require('child_process').execSync; try { var paths = new Array(); - const branch = process.env.GITHUB_REF_NAME - var keyString = 'cache-openwrt'+'-'+branch; + var keyString = 'cache-openwrt'; const prefix = core.getInput('prefix'); if ( prefix != '' ){ process.chdir(prefix); } + const branch = process.env.GITHUB_REF_NAME; + restoreKeys.unshift(keyString); + keyString = keyString+'-'+branch; + const toolchain = core.getInput('toolchain'); if ( toolchain=='true' ){ stdout=execSync('git log --pretty=tformat:"%h" -n1 tools toolchain').toString().trim(); From 2a5d345f818b27893e0473233bcfffb40ef59a30 Mon Sep 17 00:00:00 2001 From: w311ang <30381083+w311ang@users.noreply.github.com> Date: Thu, 28 Jul 2022 13:53:14 +0800 Subject: [PATCH 35/39] Delete pull.yml --- .github/pull.yml | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 .github/pull.yml diff --git a/.github/pull.yml b/.github/pull.yml deleted file mode 100644 index 34ebb6e1..00000000 --- a/.github/pull.yml +++ /dev/null @@ -1,6 +0,0 @@ -version: "1" -rules: - - base: main - upstream: klever1988:main # change `wei` to the owner of upstream repo - mergeMethod: merge - autoMerge: false From 3899f0ff0b22d609a9a9296e3ef799e5473ec6ce Mon Sep 17 00:00:00 2001 From: w311ang <30381083+w311ang@users.noreply.github.com> Date: Thu, 28 Jul 2022 13:53:22 +0800 Subject: [PATCH 36/39] Delete test.yml --- .github/workflows/test.yml | 21 --------------------- 1 file changed, 21 deletions(-) delete mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index 21bf1ae9..00000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: Test - -on: - push: - paths-ignore: - - 'README.md' - workflow_dispatch: - -jobs: - build: - runs-on: ubuntu-latest - steps: - - run: echo ${{ github.ref_name }} - - name: Make openwrt directory - run: git clone https://github.com/coolsnowwolf/lede.git openwrt - - name: cache - uses: w311angg/cachewrtbuild@main - with: - ccache: true - prefix: ${{ github.workspace }}/openwrt - branch: ${{ github.ref_name }} From ac55c14383caec97ea7b25337dbc41ab979abdb2 Mon Sep 17 00:00:00 2001 From: w311ang <30381083+w311ang@users.noreply.github.com> Date: Thu, 28 Jul 2022 13:56:52 +0800 Subject: [PATCH 37/39] Update save.js --- save.js | 1 - 1 file changed, 1 deletion(-) diff --git a/save.js b/save.js index 10575198..6dbb3fa2 100644 --- a/save.js +++ b/save.js @@ -11,7 +11,6 @@ try { } const branch = process.env.GITHUB_REF_NAME; - restoreKeys.unshift(keyString); keyString = keyString+'-'+branch; const toolchain = core.getInput('toolchain'); From 250fb5c14fc4d5085089abb604d9de2a0ab23616 Mon Sep 17 00:00:00 2001 From: w311ang <30381083+w311ang@users.noreply.github.com> Date: Thu, 28 Jul 2022 13:57:16 +0800 Subject: [PATCH 38/39] Delete pull.yml --- .github/pull.yml | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 .github/pull.yml diff --git a/.github/pull.yml b/.github/pull.yml deleted file mode 100644 index 34ebb6e1..00000000 --- a/.github/pull.yml +++ /dev/null @@ -1,6 +0,0 @@ -version: "1" -rules: - - base: main - upstream: klever1988:main # change `wei` to the owner of upstream repo - mergeMethod: merge - autoMerge: false From ea35b02076e649b20e0bdab7fb24d093d23cfc8f Mon Sep 17 00:00:00 2001 From: w311ang <30381083+w311ang@users.noreply.github.com> Date: Thu, 28 Jul 2022 13:57:30 +0800 Subject: [PATCH 39/39] Delete test.yml --- .github/workflows/test.yml | 21 --------------------- 1 file changed, 21 deletions(-) delete mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index 21bf1ae9..00000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: Test - -on: - push: - paths-ignore: - - 'README.md' - workflow_dispatch: - -jobs: - build: - runs-on: ubuntu-latest - steps: - - run: echo ${{ github.ref_name }} - - name: Make openwrt directory - run: git clone https://github.com/coolsnowwolf/lede.git openwrt - - name: cache - uses: w311angg/cachewrtbuild@main - with: - ccache: true - prefix: ${{ github.workspace }}/openwrt - branch: ${{ github.ref_name }}