diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..0449e4a --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,10 @@ +# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates + +version: 2 +updates: + - package-ecosystem: "npm" + directory: "/" + schedule: + interval: "weekly" + allow: + - dependency-type: production diff --git a/.github/workflows/ci-test-win.yml b/.github/workflows/ci-test-win.yml deleted file mode 100644 index c64f9fd..0000000 --- a/.github/workflows/ci-test-win.yml +++ /dev/null @@ -1,36 +0,0 @@ -name: Tests - Windows - -on: [ push, pull_request ] - -# no docker/images support on Windows (currently), so run w/o Redis -# also, stack run commands so test doesn't begin before install completes - -jobs: - - ci-test-win: - - runs-on: ${{ matrix.os }} - - strategy: - matrix: - os: [ windows-latest ] - node-version: [10.x, 12.x, 14.x] - fail-fast: false - - steps: - - uses: actions/checkout@v1 - name: Checkout Code - with: - fetch-depth: 1 - - - uses: actions/setup-node@v1 - name: Use Node.js ${{ matrix.node-version }} - with: - node-version: ${{ matrix.node-version }} - - - name: npm install and test - run: | - npm install - npm run test - env: - CI: true diff --git a/.github/workflows/ci-test.yml b/.github/workflows/ci-test.yml deleted file mode 100644 index 27abc3f..0000000 --- a/.github/workflows/ci-test.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: Tests - -on: [ push, pull_request ] - -jobs: - - ci-test: - - runs-on: ${{ matrix.os }} - - strategy: - matrix: - os: [ ubuntu-latest ] - node-version: [10.x, 12.x, 14.x] - fail-fast: false - - steps: - - uses: actions/checkout@v2 - name: Checkout Code - with: - fetch-depth: 1 - - - uses: actions/setup-node@v1 - name: Use Node.js ${{ matrix.node-version }} - with: - node-version: ${{ matrix.node-version }} - - - name: npm install - run: npm install - - - name: Run test suite - run: npm run test - env: - CI: true diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..d768329 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,41 @@ +name: CI + +on: [ push ] + +env: + CI: true + +jobs: + + lint: + uses: haraka/.github/.github/workflows/lint.yml@master + + # coverage: + # uses: haraka/.github/.github/workflows/coverage.yml@master + # secrets: inherit + + test: + needs: [ lint, get-lts ] + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ ubuntu-latest, windows-latest ] + node-version: ${{ fromJson(needs.get-lts.outputs.active) }} + fail-fast: false + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + name: Node ${{ matrix.node-version }} on ${{ matrix.os }} + with: + node-version: ${{ matrix.node-version }} + - run: npm install + - run: npm test + + get-lts: + runs-on: ubuntu-latest + steps: + - id: get + uses: msimerson/node-lts-versions@v1 + outputs: + active: ${{ steps.get.outputs.active }} + lts: ${{ steps.get.outputs.lts }} diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 0000000..383aca2 --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,13 @@ +name: "CodeQL" + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + schedule: + - cron: '18 7 * * 4' + +jobs: + codeql: + uses: haraka/.github/.github/workflows/codeql.yml@master diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml deleted file mode 100644 index 338a034..0000000 --- a/.github/workflows/lint.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: Lint - -on: [ push, pull_request ] - -jobs: - - lint: - - runs-on: ubuntu-latest - - strategy: - matrix: - node-version: [ 12.x ] - - steps: - - uses: actions/checkout@v2 - name: Checkout Code - with: - fetch-depth: 1 - - - uses: actions/setup-node@v1 - name: Use Node.js ${{ matrix.node-version }} - with: - node-version: ${{ matrix.node-version }} - - - name: npm install - run: npm install - - - name: Lint using eslint - run: npm run lint - env: - CI: true \ No newline at end of file diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml deleted file mode 100644 index a905de7..0000000 --- a/.github/workflows/master.yml +++ /dev/null @@ -1,42 +0,0 @@ - -name: publish - -on: - push: - branches: - - master - -env: - node_version: 14 - -jobs: - - publish-npm: - runs-on: ubuntu-latest - - steps: - - name: Checkout - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - name: Setup node.js ${{ env.node_version }} - uses: actions/setup-node@v2 - with: - node-version: ${{ env.node_version }} - registry-url: https://registry.npmjs.org/ - - - name: npm install - run: npm install - - - name: Run test suite - run: npm run test - - - name: publish to NPM - run: npm publish --access public - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} - - - name: GitHub Release - uses: justincy/github-action-npm-release@2.0.1 - id: release diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..42a9bb9 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,14 @@ +name: publish + +on: + push: + branches: + - master + +env: + CI: true + +jobs: + publish: + uses: haraka/.github/.github/workflows/publish.yml@master + secrets: inherit \ No newline at end of file diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..a8e94cb --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule ".release"] + path = .release + url = git@github.com:msimerson/.release.git diff --git a/.release b/.release new file mode 160000 index 0000000..9be2b27 --- /dev/null +++ b/.release @@ -0,0 +1 @@ +Subproject commit 9be2b270ef836bcfefda085674bf62e2a91defe8 diff --git a/Changes.md b/Changes.md index 97c7623..6a79777 100644 --- a/Changes.md +++ b/Changes.md @@ -1,4 +1,15 @@ +### Unreleased + + +### [1.0.7] - 2022-06-05 + +- ci: update GHA workflow with shared +- doc(changes): add Unreleased marker +- ci: add submodule .release +- test: require mocha >= 9 + + ### 1.0.6 - 2021-11-10 - bump eslint 6 -> 8 @@ -33,3 +44,6 @@ ### 1.0.0 - 2017-07-27 - import from Haraka + + +[1.0.7]: https://github.com/haraka/haraka-plugin-p0f/releases/tag/1.0.7 diff --git a/README.md b/README.md index a0486e5..544ce81 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,5 @@ [![Build Status][ci-img]][ci-url] [![Code Climate][clim-img]][clim-url] -[![Windows Build Status][ci-win-img]][ci-win-url] [![NPM][npm-img]][npm-url] # haraka-plugin-p0f @@ -60,12 +59,8 @@ In the contrib/bsd-rc.d directory is a startup file for FreeBSD. -[ci-img]: https://github.com/haraka/haraka-plugin-p0f/workflows/Tests/badge.svg -[ci-url]: https://github.com/haraka/haraka-plugin-p0f/actions?query=workflow%3ATests -[ci-win-img]: https://github.com/haraka/haraka-plugin-p0f/workflows/Tests%20-%20Windows/badge.svg -[ci-win-url]: https://github.com/haraka/haraka-plugin-p0f/actions?query=workflow%3A%22Tests+-+Windows%22 -[cov-img]: https://codecov.io/github/haraka/haraka-plugin-p0f/coverage.svg -[cov-url]: https://codecov.io/github/haraka/haraka-plugin-p0f +[ci-img]: https://github.com/haraka/haraka-plugin-p0f/actions/workflows/ci.yml/badge.svg +[ci-url]: https://github.com/haraka/haraka-plugin-p0f/actions/workflows/ci.yml [clim-img]: https://codeclimate.com/github/haraka/haraka-plugin-p0f/badges/gpa.svg [clim-url]: https://codeclimate.com/github/haraka/haraka-plugin-p0f [npm-img]: https://nodei.co/npm/haraka-plugin-p0f.png diff --git a/package.json b/package.json index fdb20d1..bac33d4 100644 --- a/package.json +++ b/package.json @@ -1,12 +1,12 @@ { "name": "haraka-plugin-p0f", - "version": "1.0.6", + "version": "1.0.7", "description": "Haraka plugin that adds TCP fingerprinting", "main": "index.js", "scripts": { "cover": "NODE_ENV=cov npx nyc --reporter=lcovonly npm run test", - "lint": "npx eslint *.js test/*.js", - "lintfix": "npx eslint --fix *.js test/*.js", + "lint": "npx eslint *.js test", + "lintfix": "npx eslint --fix *.js test", "test": "npx mocha" }, "repository": { @@ -28,7 +28,7 @@ "eslint": ">=8", "eslint-plugin-haraka": "*", "haraka-test-fixtures": "*", - "mocha": "*" + "mocha": ">=9" }, "dependencies": { "ipaddr.js": "^2.0.1"