serverless / serverless-tencent

⚡️ 🐧 Serverless Tencent CLI 及中文讨论社区
https://cn.serverless.com
63 stars 26 forks source link

feat: generate binaries for serverelss-tencent CLI #83

Closed zongUMR closed 2 years ago

zongUMR commented 2 years ago

Close:

  1. https://app.asana.com/0/0/1201436337482654/f
  2. https://app.asana.com/0/0/1201436337482655/f

    This PR will do two things in github CI:

  3. pkg:build to build three binaries: serverless-tencent-linux, serverless-tencent-macos, serverless-tencent-win.exe for platforms: linux-x64, mac-x64, win-654
  4. pkg:upload to upload these binaries to our Tencent COS: slt-binary-sv-1300963013, its region is Silicon Valley, you can see the details , so I think we can have a good upload speed in github CI.
  5. After upload the binaries to COS successfully, we will have a new directory named with the version of CLI Screen Shot 2021-11-30 at 10 59 27, and binaries will be put inside it Screen Shot 2021-11-30 at 11 00 35
  6. it will also create or update the content of latest-tag file, which contains the latest version. Screen Shot 2021-11-30 at 11 07 18

Ps. I have not tested it in the real Github CI. I only built and uploaded the binaries on my local and it works well, if you want to test locally:

  1. npm i
  2. npm run build
  3. npm run pkg:build
  4. TENCENT_SECRET_KEY=xxx TENCENT_SECRET_ID=xxx npm run pkg:upload -- TAG
github-actions[bot] commented 2 years ago

:loop: Code coverage

Filename Statements Branches Functions Lines
src/libs/utils/index.js 100% 100% 100% 100%
src/libs/utils/basic.js 34.63% 24.73% 44.12% 34.55%
src/libs/utils/utils.js 62.85% 40.14% 60% 61.48%
src/libs/config.js 70.37% 67.14% 100% 70.37%
src/libs/cli.js 60.34% 41.67% 45.83% 61.4%
tests/testUtils.js 85.71% 100% 75% 85.71%