From 5c7686f9423baf9f549d00c1c968736b26005a9f Mon Sep 17 00:00:00 2001 From: Alain Date: Wed, 22 Jun 2022 16:36:08 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=86=20CI=20=E4=BB=8E=20trivas=20=E5=88=87?= =?UTF-8?q?=E6=8D=A2=E4=B8=BA=20github=20actions=20(#584)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 添加 actions 脚本 * 移除 travis 配置文件 * 优化 publish 的触发阶段 --- .github/workflows/dev-check.yml | 35 +++++++++++++++++++++++++++++++ .github/workflows/npm-publish.yml | 20 ++++++++++++++++++ .npmignore | 4 +++- .travis.yml | 30 -------------------------- 4 files changed, 58 insertions(+), 31 deletions(-) create mode 100644 .github/workflows/dev-check.yml create mode 100644 .github/workflows/npm-publish.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/dev-check.yml b/.github/workflows/dev-check.yml new file mode 100644 index 00000000..54dfcfd0 --- /dev/null +++ b/.github/workflows/dev-check.yml @@ -0,0 +1,35 @@ +name: Dev check + +on: [pull_request,push] + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + cache: 'npm' + node-version: 12 + - run: npm install + - run: npm run lint + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + cache: 'npm' + node-version: 12 + - run: npm install + - run: npm run test + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + cache: 'npm' + node-version: 12 + - run: npm install + - run: npm run build diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml new file mode 100644 index 00000000..82c83a63 --- /dev/null +++ b/.github/workflows/npm-publish.yml @@ -0,0 +1,20 @@ +name: Npm publish + +on: + release: + types: [published] + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 12 + registry-url: https://registry.npmjs.org/ + - run: npm install + - run: npm run build + - run: npm publish + env: + NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} diff --git a/.npmignore b/.npmignore index 244c5479..7021f617 100644 --- a/.npmignore +++ b/.npmignore @@ -3,5 +3,7 @@ node_modules bower_components deploy.sh npm-debug.log -test/config.json +.github +.vscode +test site diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 589f43e4..00000000 --- a/.travis.yml +++ /dev/null @@ -1,30 +0,0 @@ -language: node_js - -node_js: - - "12" - -cache: - directories: - - node_modules - -install: - - npm install - -script: - - npm run lint - - npm run test - - npx codecov - - npm run build - -before_deploy: - - npm run build - -deploy: - provider: npm - email: sdk@qiniu.com - skip_cleanup: true - api_key: - secure: L9V1k9Y6CFC5fIBRbGbpvhpb004kI9Z/Wvwp5xGnVuGO3n6OfEVoaX7gSLpOkyx4kZfzEEh+R9xriJAeXBfLjiigP1FrKm+EQ92VlkjGh+Dlc4NDwEO00RczfUxI4bQG/HVaVTsQs+EqCnkfsp403wECwuBS68zYtsJZldREmDo= - on: - tags: true - repo: qiniu/js-sdk