From 0c276c3f5d3483b419237d7310494ef1b0ab711c Mon Sep 17 00:00:00 2001 From: Kenan Yildirim Date: Tue, 25 Aug 2020 16:21:16 -0400 Subject: [PATCH] chore(ci): set up semantic release --- .gitattributes | 2 +- .github/dependabot.yml | 8 ++++++++ .github/workflows/nodejs.yml | 27 +++++++++++++++++++++++++++ .github/workflows/release.yml | 28 ++++++++++++++++++++++++++++ .npmrc | 1 + .releaserc.json | 12 ++++++++++++ .travis.yml | 7 ------- README.md | 3 --- package.json | 8 ++++++++ 9 files changed, 85 insertions(+), 11 deletions(-) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/nodejs.yml create mode 100644 .github/workflows/release.yml create mode 100644 .npmrc create mode 100644 .releaserc.json delete mode 100644 .travis.yml diff --git a/.gitattributes b/.gitattributes index 2125666..6313b56 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1 +1 @@ -* text=auto \ No newline at end of file +* text=auto eol=lf diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..05ee6fe --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,8 @@ +version: 2 +updates: + - package-ecosystem: github-actions + directory: / + schedule: + interval: daily + labels: + - ci diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml new file mode 100644 index 0000000..ae21e4f --- /dev/null +++ b/.github/workflows/nodejs.yml @@ -0,0 +1,27 @@ +name: nodejs +on: [pull_request, push] +jobs: + build: + runs-on: ${{ matrix.os }} + strategy: + matrix: + node-version: [10, 12, 14] + os: [ubuntu-latest, windows-latest, macOS-latest] + steps: + - name: Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v2.1.1 + with: + node-version: ${{ matrix.node-version }} + - name: Update npm + run: | + npm install -g npm + npm --version + - uses: actions/checkout@v2.3.2 + - name: Install dependencies + uses: bahmutov/npm-install@v1.4.3 + with: + useLockFile: false + - name: npm ls + run: npm ls + - name: Test + run: npm test diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..4a386b0 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,28 @@ +name: release +on: + push: + branches: + - master +jobs: + release: + name: release + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2.3.2 + - name: Node.js + uses: actions/setup-node@v2.1.1 + with: + node-version: 12 + - name: Update npm + run: | + npm install -g npm + npm --version + - name: Install dependencies + uses: bahmutov/npm-install@v1.4.3 + with: + useLockFile: false + - name: Release + run: npm run release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000..c1ca392 --- /dev/null +++ b/.npmrc @@ -0,0 +1 @@ +package-lock = false diff --git a/.releaserc.json b/.releaserc.json new file mode 100644 index 0000000..7c18122 --- /dev/null +++ b/.releaserc.json @@ -0,0 +1,12 @@ +{ + "plugins": [ + "@semantic-release/commit-analyzer", + "@semantic-release/release-notes-generator", + "@semantic-release/changelog", + "@semantic-release/github", + "@semantic-release/npm", + "@semantic-release/git" + ], + "preset": "conventionalcommits", + "tagFormat": "${version}" +} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index cbb093a..0000000 --- a/.travis.yml +++ /dev/null @@ -1,7 +0,0 @@ -language: node_js -node_js: - - '12' - - '10' -before_install: - - npm install -g npm - - npm --version diff --git a/README.md b/README.md index fa95efa..b03878f 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,5 @@ # get-random-values -[![Build Status](https://img.shields.io/travis/KenanY/get-random-values.svg)](https://travis-ci.org/KenanY/get-random-values) -[![Dependency Status](https://img.shields.io/gemnasium/KenanY/get-random-values.svg)](https://gemnasium.com/KenanY/get-random-values) - `window.crypto.getRandomValues` or `window.msCrypto.getRandomValues` or `require('crypto').randomBytes` or an _Error_. diff --git a/package.json b/package.json index 46fcc29..e5dbeb7 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,11 @@ "directories": { "test": "test" }, + "engines": { + "node": "10 || 12 || >=14" + }, "scripts": { + "release": "semantic-release", "test": "tape test/*.js" }, "dependencies": { @@ -24,9 +28,13 @@ }, "devDependencies": { "@kenan/renovate-config": "1.4.0", + "@semantic-release/changelog": "5.0.1", + "@semantic-release/git": "9.0.0", + "conventional-changelog-conventionalcommits": "4.4.0", "is-browser": "2.1.0", "lodash.foreach": "4.5.0", "lodash.isfunction": "3.0.9", + "semantic-release": "17.1.1", "tape": "5.0.1" }, "browser": {