diff --git a/.github/workflows/ncc.yml b/.github/workflows/ncc.yml index dd42a46..9f4dbfe 100644 --- a/.github/workflows/ncc.yml +++ b/.github/workflows/ncc.yml @@ -21,8 +21,8 @@ jobs: id: selftest uses: ./ with: - src: './func.cjs' - ncc_args: '-o testdist' + src: 'index.cjs' + #ncc_args: '-o testdist' - uses: EndBug/add-and-commit@v9 if: ${{ github.actor != 'dependabot[bot]' }} diff --git a/__test__/func.test.js b/__test__/func.test.js index 934b943..f9cdb52 100644 --- a/__test__/func.test.js +++ b/__test__/func.test.js @@ -41,7 +41,7 @@ describe('run', () => { expect(core.startGroup).toHaveBeenCalledWith('Compiling /my/workdir/index.js'); expect(await exec.exec).toHaveBeenCalledTimes(2); - expect(await exec.exec).toHaveBeenNthCalledWith (1,'npm', ['install', "--no-save"]); + expect(await exec.exec).toHaveBeenNthCalledWith (1,'yarn', ['install', "--no-save"]); expect(await exec.exec).toHaveBeenNthCalledWith (2,'npx', ['@vercel/ncc', 'build', '/my/workdir/index.js']); expect(core.endGroup).toHaveBeenCalledWith('Compiling /my/workdir/index.js'); expect(core.info).toHaveBeenCalledWith('Compiled successfully 📦 🎉 '); diff --git a/action.yml b/action.yml index 7dbee5f..cb56027 100644 --- a/action.yml +++ b/action.yml @@ -1,6 +1,6 @@ name: 'ncc action' -description: 'use @sidey79/ncc to compile and push your github action dist! 🚀' -author: 'Sven Butzek' +description: 'use sidey79/ncc to compile and push your github action dist! 🚀' +author: 'Sidey79' inputs: src: description: 'source code dir/file to compile' @@ -10,7 +10,7 @@ inputs: required: false runs: using: 'node20' - main: 'dist/index.js' + main: 'dist/index.cjs' branding: icon: 'box' color: 'green' diff --git a/func.cjs b/func.cjs index 1b446a3..67167a5 100644 --- a/func.cjs +++ b/func.cjs @@ -15,7 +15,7 @@ async function run_compile() { core.startGroup(`Compiling ${src}`); // install dependencies - await exec('npm', ['install', "--no-save"]); + await exec.exec('yarn', ['install', "--no-save"]); // compile code const compileArgs = ['@vercel/ncc', 'build', src]; @@ -25,7 +25,7 @@ async function run_compile() { compileArgs.push(...args); } - await exec('npx', compileArgs); + await exec.exec('npx', compileArgs); core.endGroup(`Compiling ${src}`); diff --git a/yarn.lock b/yarn.lock index c762ae4..c8d4436 100644 --- a/yarn.lock +++ b/yarn.lock @@ -26,9 +26,9 @@ undici "^5.25.4" "@actions/io@^1.0.1": - version "1.1.1" - resolved "https://registry.npmjs.org/@actions/io/-/io-1.1.1.tgz" - integrity sha512-Qi4JoKXjmE0O67wAOH6y0n26QXhMKMFo7GD/4IXNVcrtLjUlGjGuVys6pQgwF3ArfGTQu0XpqaNr0YhED2RaRA== + version "1.1.3" + resolved "https://registry.npmjs.org/@actions/io/-/io-1.1.3.tgz" + integrity sha512-wi9JjgKLYS7U/z8PPbco+PvTb/nRWjeoFlJ1Qer83k/3C5PHQi28hiVdeE2kHXmIL99mQFawx8qt/JPjZilJ8Q== "@ampproject/remapping@^2.2.0": version "2.3.0" @@ -333,9 +333,9 @@ eslint-visitor-keys "^3.3.0" "@eslint-community/regexpp@^4.6.1": - version "4.10.0" - resolved "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.10.0.tgz" - integrity sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA== + version "4.12.1" + resolved "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.1.tgz" + integrity sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ== "@eslint/config-array@^0.15.1": version "0.15.1" @@ -1056,7 +1056,7 @@ cross-spawn@^7.0.2, cross-spawn@^7.0.3: debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2: version "4.3.5" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.5.tgz#e83444eceb9fedd4a1da56d671ae2446a01a6e1e" + resolved "https://registry.npmjs.org/debug/-/debug-4.3.5.tgz" integrity sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg== dependencies: ms "2.1.2" @@ -1917,7 +1917,7 @@ jest-worker@^29.7.0: merge-stream "^2.0.0" supports-color "^8.0.0" -jest@^29.3.1: +jest@^29.7.0: version "29.7.0" resolved "https://registry.npmjs.org/jest/-/jest-29.7.0.tgz" integrity sha512-NIy3oAFp9shda19hy4HK0HRTWKtPJmGdnvywu01nOqNC2vZg+Z+fvJDxpMQA88eb2I9EcafcdjYgsDthnYTvGw==