From 0fb9bbaf1e948ae3e9d037e573a6ce0e187f94ea Mon Sep 17 00:00:00 2001 From: fernando Date: Thu, 17 Mar 2022 00:03:09 -0300 Subject: [PATCH 01/15] Add git hub actions Signed-off-by: Rafael Willians --- .github/workflows/github-actions.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/workflows/github-actions.yml diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml new file mode 100644 index 0000000..252d318 --- /dev/null +++ b/.github/workflows/github-actions.yml @@ -0,0 +1,26 @@ +name: Express Rescue gitHub actions + +on: pull_request + +jobs: + scripts: + runs-on: ubuntu-latest + steps: + - name: Check out repository code + uses: actions/checkout@v2 + - name: Setting up node + uses: actions/setup-node@v2 + with: + node-version: 14 + - name: Install dependencies + run: npm install + - name: Build the code + run: npm run build + - name: Run lint + run: npm run lint + - name: Run test + run: npm run test + - name: Run coverage + run: npm run coverage + - name: Run coverage report + run: npm install -g coveralls && npm run coverage:report | coveralls \ No newline at end of file From a8e8675a189e5e610f34ce3a574ee43c15b73e55 Mon Sep 17 00:00:00 2001 From: fernando Date: Thu, 17 Mar 2022 00:03:16 -0300 Subject: [PATCH 02/15] Add publish action Signed-off-by: Rafael Willians --- .github/workflows/publish-action.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .github/workflows/publish-action.yml diff --git a/.github/workflows/publish-action.yml b/.github/workflows/publish-action.yml new file mode 100644 index 0000000..be598f7 --- /dev/null +++ b/.github/workflows/publish-action.yml @@ -0,0 +1,18 @@ +name: Publish Package to npm +on: + release: + types: [created] +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: '14.x' + registry-url: 'https://registry.npmjs.org' + - run: npm install + - run: npm run build + - run: npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} \ No newline at end of file From c5ed3a7e8823fcf9fecdfb82aba4b26d36cf7ad3 Mon Sep 17 00:00:00 2001 From: fernando Date: Thu, 17 Mar 2022 00:04:56 -0300 Subject: [PATCH 03/15] Add newline at the end of the file Signed-off-by: Rafael Willians --- .github/workflows/github-actions.yml | 2 +- .github/workflows/publish-action.yml | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml index 252d318..b20c8f2 100644 --- a/.github/workflows/github-actions.yml +++ b/.github/workflows/github-actions.yml @@ -23,4 +23,4 @@ jobs: - name: Run coverage run: npm run coverage - name: Run coverage report - run: npm install -g coveralls && npm run coverage:report | coveralls \ No newline at end of file + run: npm install -g coveralls && npm run coverage:report | coveralls diff --git a/.github/workflows/publish-action.yml b/.github/workflows/publish-action.yml index be598f7..d8df411 100644 --- a/.github/workflows/publish-action.yml +++ b/.github/workflows/publish-action.yml @@ -1,7 +1,9 @@ name: Publish Package to npm + on: release: types: [created] + jobs: build: runs-on: ubuntu-latest @@ -15,4 +17,4 @@ jobs: - run: npm run build - run: npm publish env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} \ No newline at end of file + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} From 4a6dfb1e682cc984518ab7df52a9c14710a8e935 Mon Sep 17 00:00:00 2001 From: fernando Date: Thu, 17 Mar 2022 00:24:42 -0300 Subject: [PATCH 04/15] Fixing coveralls Signed-off-by: Rafael Willians --- .github/workflows/github-actions.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml index b20c8f2..dd5f1e3 100644 --- a/.github/workflows/github-actions.yml +++ b/.github/workflows/github-actions.yml @@ -8,19 +8,29 @@ jobs: steps: - name: Check out repository code uses: actions/checkout@v2 + - name: Setting up node uses: actions/setup-node@v2 with: node-version: 14 + - name: Install dependencies run: npm install + - name: Build the code run: npm run build + - name: Run lint run: npm run lint + - name: Run test run: npm run test + - name: Run coverage run: npm run coverage - - name: Run coverage report - run: npm install -g coveralls && npm run coverage:report | coveralls + + - name: Run coveralls + uses: coverallsapp/github-action@v1.1.0 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + parallel: true From 34236f6faf231bc2c4ed794fb2ba5547e87a00fb Mon Sep 17 00:00:00 2001 From: fernando Date: Thu, 17 Mar 2022 00:46:55 -0300 Subject: [PATCH 05/15] Change publish action job to 'publish' Signed-off-by: Rafael Willians --- .github/workflows/publish-action.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish-action.yml b/.github/workflows/publish-action.yml index d8df411..bdcae90 100644 --- a/.github/workflows/publish-action.yml +++ b/.github/workflows/publish-action.yml @@ -1,20 +1,24 @@ -name: Publish Package to npm +name: Publish Package to NPM on: release: types: [created] jobs: - build: + publish: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 with: node-version: '14.x' registry-url: 'https://registry.npmjs.org' + - run: npm install + - run: npm run build + - run: npm publish env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} From 1a58291eb319593fbcd132c194e29a384ec4944b Mon Sep 17 00:00:00 2001 From: fernando Date: Thu, 17 Mar 2022 00:49:46 -0300 Subject: [PATCH 06/15] Updating package.json version Signed-off-by: Rafael Willians --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b072348..3376a28 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "express-rescue", - "version": "1.1.31", + "version": "1.1.33", "description": "A wrapper for async functions which makes sure all async errors are passed to your errors handler", "license": "MIT", "keywords": [ From 8c51b6c516b4303726d0eccd737e30440b4937bc Mon Sep 17 00:00:00 2001 From: Fernando Date: Wed, 3 Aug 2022 23:14:54 -0300 Subject: [PATCH 07/15] Remove upgrade version Signed-off-by: Rafael Willians --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 3376a28..b072348 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "express-rescue", - "version": "1.1.33", + "version": "1.1.31", "description": "A wrapper for async functions which makes sure all async errors are passed to your errors handler", "license": "MIT", "keywords": [ From c32adda65095e07669d35a7665e4cc5f4522e7d1 Mon Sep 17 00:00:00 2001 From: Fernando Date: Wed, 3 Aug 2022 23:15:18 -0300 Subject: [PATCH 08/15] Remove publish action from this branch Signed-off-by: Rafael Willians --- .github/workflows/publish-action.yml | 24 ------------------------ 1 file changed, 24 deletions(-) delete mode 100644 .github/workflows/publish-action.yml diff --git a/.github/workflows/publish-action.yml b/.github/workflows/publish-action.yml deleted file mode 100644 index bdcae90..0000000 --- a/.github/workflows/publish-action.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: Publish Package to NPM - -on: - release: - types: [created] - -jobs: - publish: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - - uses: actions/setup-node@v2 - with: - node-version: '14.x' - registry-url: 'https://registry.npmjs.org' - - - run: npm install - - - run: npm run build - - - run: npm publish - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} From 286635c3db5d6433e222594f3d05a7a4454dab96 Mon Sep 17 00:00:00 2001 From: Fernando Date: Wed, 3 Aug 2022 23:16:22 -0300 Subject: [PATCH 09/15] Update github-actions logic to fix coveralls and use matrix Signed-off-by: Rafael Willians --- .github/workflows/github-actions.yml | 41 +++++++++++++++++++++++++--- 1 file changed, 37 insertions(+), 4 deletions(-) diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml index dd5f1e3..b9ca22e 100644 --- a/.github/workflows/github-actions.yml +++ b/.github/workflows/github-actions.yml @@ -5,14 +5,29 @@ on: pull_request jobs: scripts: runs-on: ubuntu-latest + strategy: + matrix: + node: + - 7 + - 8 + - 9 + - 10 + - 11 + - 12 + - 13 + - 14 + - 15 + - 16 + - 17 + steps: - name: Check out repository code uses: actions/checkout@v2 - name: Setting up node - uses: actions/setup-node@v2 + uses: actions/setup-node@v3 with: - node-version: 14 + node-version: ${{ matrix.node }} - name: Install dependencies run: npm install @@ -26,11 +41,29 @@ jobs: - name: Run test run: npm run test + coverage: + needs: scripts + runs-on: ubuntu-latest + steps: + - name: Check out repository code + uses: actions/checkout@v2 + + - name: Use Node.js 17.x + uses: actions/setup-node@v3 + with: + node-version: 17.x + check-latest: true + + - name: Install dependencies + run: npm install + + - name: Build the code + run: npm run build + - name: Run coverage run: npm run coverage - name: Run coveralls uses: coverallsapp/github-action@v1.1.0 with: - github-token: ${{ secrets.GITHUB_TOKEN }} - parallel: true + github-token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file From fcac31845ced9b5707d66609f07258467e9e4e35 Mon Sep 17 00:00:00 2001 From: Fernando Date: Wed, 3 Aug 2022 23:20:06 -0300 Subject: [PATCH 10/15] Add publish-action to workflows Signed-off-by: Rafael Willians --- .github/workflows/github-actions.yml | 1 + .github/workflows/publish-action.yml | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 .github/workflows/publish-action.yml diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml index b9ca22e..62205ba 100644 --- a/.github/workflows/github-actions.yml +++ b/.github/workflows/github-actions.yml @@ -44,6 +44,7 @@ jobs: coverage: needs: scripts runs-on: ubuntu-latest + steps: - name: Check out repository code uses: actions/checkout@v2 diff --git a/.github/workflows/publish-action.yml b/.github/workflows/publish-action.yml new file mode 100644 index 0000000..bdcae90 --- /dev/null +++ b/.github/workflows/publish-action.yml @@ -0,0 +1,24 @@ +name: Publish Package to NPM + +on: + release: + types: [created] + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - uses: actions/setup-node@v2 + with: + node-version: '14.x' + registry-url: 'https://registry.npmjs.org' + + - run: npm install + + - run: npm run build + + - run: npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} From 5ee89c4f84df275bea5046d5c5fceeea4bb717e4 Mon Sep 17 00:00:00 2001 From: Rafael Willians Date: Thu, 4 Aug 2022 14:56:09 -0300 Subject: [PATCH 11/15] Deleted duplicated workflow --- .github/workflows/github-actions.yml | 70 ---------------------------- 1 file changed, 70 deletions(-) delete mode 100644 .github/workflows/github-actions.yml diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml deleted file mode 100644 index 62205ba..0000000 --- a/.github/workflows/github-actions.yml +++ /dev/null @@ -1,70 +0,0 @@ -name: Express Rescue gitHub actions - -on: pull_request - -jobs: - scripts: - runs-on: ubuntu-latest - strategy: - matrix: - node: - - 7 - - 8 - - 9 - - 10 - - 11 - - 12 - - 13 - - 14 - - 15 - - 16 - - 17 - - steps: - - name: Check out repository code - uses: actions/checkout@v2 - - - name: Setting up node - uses: actions/setup-node@v3 - with: - node-version: ${{ matrix.node }} - - - name: Install dependencies - run: npm install - - - name: Build the code - run: npm run build - - - name: Run lint - run: npm run lint - - - name: Run test - run: npm run test - - coverage: - needs: scripts - runs-on: ubuntu-latest - - steps: - - name: Check out repository code - uses: actions/checkout@v2 - - - name: Use Node.js 17.x - uses: actions/setup-node@v3 - with: - node-version: 17.x - check-latest: true - - - name: Install dependencies - run: npm install - - - name: Build the code - run: npm run build - - - name: Run coverage - run: npm run coverage - - - name: Run coveralls - uses: coverallsapp/github-action@v1.1.0 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file From e4cb69dffec2abca3ffd80887cdfcede290c7184 Mon Sep 17 00:00:00 2001 From: Rafael Willians Date: Thu, 4 Aug 2022 14:58:15 -0300 Subject: [PATCH 12/15] Renamed workflow --- .github/workflows/{publish-action.yml => release.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{publish-action.yml => release.yml} (100%) diff --git a/.github/workflows/publish-action.yml b/.github/workflows/release.yml similarity index 100% rename from .github/workflows/publish-action.yml rename to .github/workflows/release.yml From c7db5e4dd4f3b2e1ee86899ff8ba7aa5902580ee Mon Sep 17 00:00:00 2001 From: Rafael Willians Date: Thu, 4 Aug 2022 14:58:52 -0300 Subject: [PATCH 13/15] Release workflow now runs on tags and the tag must match the package's version --- .github/workflows/release.yml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index bdcae90..acda6fc 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,8 +1,9 @@ -name: Publish Package to NPM +name: Release on: - release: - types: [created] + push: + tags: + - 'v[0-9]+.[0-9]+.[0-9]+' jobs: publish: @@ -12,12 +13,17 @@ jobs: - uses: actions/setup-node@v2 with: - node-version: '14.x' + node-version: 18 registry-url: 'https://registry.npmjs.org' - - run: npm install + - name: Tag matches package's and package-lock's version + run: | + node -e "const tag = process.env.GITHUB_REF.replace('refs/tags/v', ''); process.exit(require('./package.json').version === tag && require('./package-lock.json').version === tag ? 0 : 1);" - - run: npm run build + - name: Prepare package for publishing + run: | + npm install + npm run build - run: npm publish env: From 2114caed08dcf0a3cfcde27df60903f5b4e35dfa Mon Sep 17 00:00:00 2001 From: Rafael Willians Date: Thu, 4 Aug 2022 15:04:28 -0300 Subject: [PATCH 14/15] Bumped version to v1.1.32 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index bb48625..6243c8d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "express-rescue", - "version": "1.1.31", + "version": "1.1.32", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "express-rescue", - "version": "1.1.31", + "version": "1.1.32", "license": "MIT", "devDependencies": { "@types/express": "^4.17.13", diff --git a/package.json b/package.json index b072348..91a9dee 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "express-rescue", - "version": "1.1.31", + "version": "1.1.32", "description": "A wrapper for async functions which makes sure all async errors are passed to your errors handler", "license": "MIT", "keywords": [ From 6ca4c260fa44d31792426d12f5cca9f59e0a79ab Mon Sep 17 00:00:00 2001 From: Rafael Willians Date: Thu, 4 Aug 2022 15:12:59 -0300 Subject: [PATCH 15/15] Added step name --- .github/workflows/release.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index acda6fc..8c44a03 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,7 +7,9 @@ on: jobs: publish: + name: Publish package runs-on: ubuntu-latest + steps: - uses: actions/checkout@v2