From b1368fb3ce1ac18dad2d1b161442b6d72967121f Mon Sep 17 00:00:00 2001 From: Berkmann18 Date: Sat, 3 Jun 2023 20:53:17 +0100 Subject: [PATCH 1/6] ci(workflows): added two GH Actions One for semantic releases and one to takeover the .travis.yml file --- .github/workflows/nodejs.yml | 34 ++++++++++++++++++++++++++ .github/workflows/semantic-release.yml | 22 +++++++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 .github/workflows/nodejs.yml create mode 100644 .github/workflows/semantic-release.yml diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml new file mode 100644 index 0000000..c1a8ebd --- /dev/null +++ b/.github/workflows/nodejs.yml @@ -0,0 +1,34 @@ +name: Node.js CI + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: ['lts/*', 'node'] + + steps: + - uses: actions/checkout@v2 + - name: Set up Node ${{ matrix.node-version }} using nvm + uses: dcodeIO/setup-node-nvm@master + with: + node-version: ${{ matrix.node-version }} + - run: | + npm i -g greenkeeper-lockfile@1 + npm prune + greenkeeper-lockfile-update + + - run: | + npm ci + npm run lint + - run: greenkeeper-lockfile-upload + - run: npm t + env: + CI: true diff --git a/.github/workflows/semantic-release.yml b/.github/workflows/semantic-release.yml new file mode 100644 index 0000000..dc62cb2 --- /dev/null +++ b/.github/workflows/semantic-release.yml @@ -0,0 +1,22 @@ +name: Semantic Release + +on: + push: + branches: [ master ] + +jobs: + build-and-deploy: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Setup Node + uses: actions/setup-node@v1 + with: + node-version: '12.x' + - run: npm ci + - name: Semantic Release + uses: cycjimmy/semantic-release-action@v2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} \ No newline at end of file From 81cc66cd383f75bfea5b9eaa38c1dad88da60e13 Mon Sep 17 00:00:00 2001 From: Berkmann18 Date: Sat, 3 Jun 2023 21:07:53 +0100 Subject: [PATCH 2/6] ci: remove .travis.yml --- .travis.yml | 29 ----------------------------- 1 file changed, 29 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 6368e29..0000000 --- a/.travis.yml +++ /dev/null @@ -1,29 +0,0 @@ -language: node_js -cache: false -notifications: - email: false -node_js: - - 'stable' - - 'lts/*' -before_script: - - npm prune - - greenkeeper-lockfile-update -branches: - except: - - /^v\d+\.\d+\.\d+$/ -before_install: -- npm install -g npm -- npm install -g greenkeeper-lockfile@1 -after_script: greenkeeper-lockfile-upload -jobs: - include: - - stage: release - script: skip - deploy: - provider: script - skip_cleanup: true - script: npm run semantic-release -stages: - - name: test - - name: release - if: branch = master From 19dcc089db0d66ba96dda40465c10c94437d8dc4 Mon Sep 17 00:00:00 2001 From: Berkmann18 Date: Fri, 9 Jun 2023 18:30:37 +0100 Subject: [PATCH 3/6] feat: use dependabot over greenkeeper Greenkeeper CLI is defunct so switching to Dependabot as Greg suggested. --- .github/workflows/dependabot.yml | 13 +++++++++++++ .github/workflows/nodejs.yml | 3 --- readme.md | 2 +- 3 files changed, 14 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/dependabot.yml diff --git a/.github/workflows/dependabot.yml b/.github/workflows/dependabot.yml new file mode 100644 index 0000000..713d1f0 --- /dev/null +++ b/.github/workflows/dependabot.yml @@ -0,0 +1,13 @@ +version: 2 +updates: +- package-ecosystem: npm + directory: "/" + schedule: + interval: weekly + open-pull-requests-limit: 5 + target-branch: master + # reviewers: + # - Berkmann18 + # - RichardLitt + labels: + - dependencies \ No newline at end of file diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index c1a8ebd..f69d7d7 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -21,14 +21,11 @@ jobs: with: node-version: ${{ matrix.node-version }} - run: | - npm i -g greenkeeper-lockfile@1 npm prune - greenkeeper-lockfile-update - run: | npm ci npm run lint - - run: greenkeeper-lockfile-upload - run: npm t env: CI: true diff --git a/readme.md b/readme.md index 65787c7..7922fe9 100644 --- a/readme.md +++ b/readme.md @@ -1,8 +1,8 @@ # name-your-contributors -[![Greenkeeper badge](https://badges.greenkeeper.io/mntnr/name-your-contributors.svg)](https://greenkeeper.io/) [![npm version](https://badge.fury.io/js/name-your-contributors.svg)](https://badge.fury.io/js/name-your-contributors) [![Build Status](https://travis-ci.org/mntnr/name-your-contributors.svg?branch=master)](https://travis-ci.org/mntnr/name-your-contributors) +[![Build and Deploy](https://github.com/mntnr/name-your-contributors/actions/workflows/nodejs.yml/badge.svg)](https://github.com/mntnr/name-your-contributors/actions/workflows/nodejs.yml) [![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/) > Name your GitHub contributors; get commits, issues, and comments From 9e14d0f75559a3cfc5f6cadadcdbbffe7f8d6fe7 Mon Sep 17 00:00:00 2001 From: Berkmann18 Date: Fri, 9 Jun 2023 18:31:49 +0100 Subject: [PATCH 4/6] docs(readme): remove outdated badge --- readme.md | 1 - 1 file changed, 1 deletion(-) diff --git a/readme.md b/readme.md index 7922fe9..43fa5e7 100644 --- a/readme.md +++ b/readme.md @@ -1,7 +1,6 @@ # name-your-contributors [![npm version](https://badge.fury.io/js/name-your-contributors.svg)](https://badge.fury.io/js/name-your-contributors) -[![Build Status](https://travis-ci.org/mntnr/name-your-contributors.svg?branch=master)](https://travis-ci.org/mntnr/name-your-contributors) [![Build and Deploy](https://github.com/mntnr/name-your-contributors/actions/workflows/nodejs.yml/badge.svg)](https://github.com/mntnr/name-your-contributors/actions/workflows/nodejs.yml) [![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/) From 473842ea4f25e1e60a850d5345fb8e3ff15a06be Mon Sep 17 00:00:00 2001 From: Berkmann18 Date: Mon, 19 Jun 2023 20:46:26 +0100 Subject: [PATCH 5/6] ci: fix actions + simplify some code --- .github/workflows/nodejs.yml | 4 +--- .github/workflows/semantic-release.yml | 4 ++-- test/integration-test.js | 4 ++-- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index f69d7d7..bf2a275 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -20,9 +20,7 @@ jobs: uses: dcodeIO/setup-node-nvm@master with: node-version: ${{ matrix.node-version }} - - run: | - npm prune - + - run: npm prune - run: | npm ci npm run lint diff --git a/.github/workflows/semantic-release.yml b/.github/workflows/semantic-release.yml index dc62cb2..9221a12 100644 --- a/.github/workflows/semantic-release.yml +++ b/.github/workflows/semantic-release.yml @@ -13,10 +13,10 @@ jobs: - name: Setup Node uses: actions/setup-node@v1 with: - node-version: '12.x' + node-version: '20.x' - run: npm ci - name: Semantic Release - uses: cycjimmy/semantic-release-action@v2 + uses: codfish/semantic-release-action@v2 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }} \ No newline at end of file diff --git a/test/integration-test.js b/test/integration-test.js index c852f0e..565871d 100644 --- a/test/integration-test.js +++ b/test/integration-test.js @@ -34,7 +34,7 @@ const contribPre = { test('No contributions in a single second', t => { return main.repoContributors({ - token: token, + token, user: 'mntnr', repo: 'name-your-contributors', after: new Date('2016-01-01T15:21:08.104Z'), @@ -62,7 +62,7 @@ const compareKeys = (x, k) => // be flexible. test('Contributors before a fixed date remain static', t => { return main.repoContributors({ - token: token, + token, user: 'mntnr', repo: 'name-your-contributors', before: new Date('2017-09-21'), From 71d30a4fcab4990fcf2089a836eb0280a0709387 Mon Sep 17 00:00:00 2001 From: Berkmann18 Date: Fri, 7 Jul 2023 18:31:50 +0100 Subject: [PATCH 6/6] fix(nodejs-action): apply suggestion Apply Greg' suggestion --- .github/workflows/nodejs.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index bf2a275..67e5926 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -27,3 +27,4 @@ jobs: - run: npm t env: CI: true + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}