From 920eae2515d6372f05c6acfd69d91a8478977ef1 Mon Sep 17 00:00:00 2001 From: ersin-demirtas Date: Tue, 26 Jan 2021 21:54:22 +0000 Subject: [PATCH 1/3] removed .travis.yml and added github actions --- .github/workflows/ci.yml | 41 ++++++++++++++++++++++++++++++++++++++++ .travis.yml | 25 ------------------------ 2 files changed, 41 insertions(+), 25 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..2185fcf8 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,41 @@ +name: Node.js Test, Build, Deploy to NPM + +on: + pull_request: + release: + types: [created] + +jobs: + build: + strategy: + matrix: + node-version: [14.x, 15.x] + + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Build Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - run: yarn install + - run: yarn build + - run: yarn test + - run: yarn lint + - run: yarn test-gen + - run: yarn test-gen-env + - run: yarn check + + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Build Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: '15.x' + registry-url: 'https://registry.npmjs.org' + - run: npm install + - run: npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 58c45a58..00000000 --- a/.travis.yml +++ /dev/null @@ -1,25 +0,0 @@ -language: node_js -node_js: -- '15' -- '14' - -cache: - directories: - - node_modules - -script: -- yarn build -- yarn test -- yarn lint -- yarn test-gen -- yarn test-gen-env -- yarn check - -deploy: - provider: npm - email: $NPM_AUTH_EMAIL - api_key: $NPM_AUTH_TOKEN - on: - tags: true - node_js: '15' - skip_cleanup: true From e47bfb0136e507d21ca3add17809efc39500ca37 Mon Sep 17 00:00:00 2001 From: E Demirtas Date: Tue, 26 Jan 2021 21:59:02 +0000 Subject: [PATCH 2/3] Added new line to end of file --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2185fcf8..1450e244 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -38,4 +38,4 @@ jobs: - run: npm install - run: npm publish env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} \ No newline at end of file + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} From 2dd2c70c1628a76af77dce0df7c31c4bf931b81a Mon Sep 17 00:00:00 2001 From: ersin-demirtas Date: Fri, 12 Feb 2021 13:41:24 +0000 Subject: [PATCH 3/3] moved npm publish to its own yml file to execute on release --- .github/workflows/ci.yml | 18 ++---------------- .github/workflows/npm.yml | 20 ++++++++++++++++++++ 2 files changed, 22 insertions(+), 16 deletions(-) create mode 100644 .github/workflows/npm.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1450e244..7bf2b938 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -name: Node.js Test, Build, Deploy to NPM +name: Node.js Build and Test on: pull_request: @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - name: Build Node.js ${{ matrix.node-version }} + - name: Build Node.js ${{ matrix.node-version }} uses: actions/setup-node@v1 with: node-version: ${{ matrix.node-version }} @@ -25,17 +25,3 @@ jobs: - run: yarn test-gen - run: yarn test-gen-env - run: yarn check - - deploy: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Build Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v1 - with: - node-version: '15.x' - registry-url: 'https://registry.npmjs.org' - - run: npm install - - run: npm publish - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/npm.yml b/.github/workflows/npm.yml new file mode 100644 index 00000000..4efbcb5d --- /dev/null +++ b/.github/workflows/npm.yml @@ -0,0 +1,20 @@ +name: Deploy to NPM + +on: + push: + tags: + - '*' +jobs: + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Build Node.js 15.x + uses: actions/setup-node@v1 + with: + node-version: '15.x' + registry-url: 'https://registry.npmjs.org' + - run: npm install + - run: npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}