From 45cc7b807ce2b380a8d101b4976ad6f6efa78a5e Mon Sep 17 00:00:00 2001 From: Kenan Yildirim Date: Thu, 1 Apr 2021 17:51:13 -0400 Subject: [PATCH] chore(ci): set up semantic-release --- .editorconfig | 9 +++++++++ .github/workflows/release.yml | 27 +++++++++++++++++++++++++++ .npmrc | 1 + .releaserc.json | 12 ++++++++++++ package.json | 19 ++++++++++++------- 5 files changed, 61 insertions(+), 7 deletions(-) create mode 100644 .editorconfig create mode 100644 .github/workflows/release.yml create mode 100644 .npmrc create mode 100644 .releaserc.json diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..0f17867 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,9 @@ +root = true + +[*] +charset = utf-8 +end_of_line = lf +indent_size = 2 +indent_style = space +insert_final_newline = true +trim_trailing_whitespace = true diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..46565ea --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,27 @@ +name: release +on: + push: + branches: + - master +jobs: + release: + name: release + runs-on: ubuntu-latest + steps: + - uses: actions/setup-node@v2.1.5 + with: + node-version: 14 + - name: Update npm + run: | + npm install -g npm + npm --version + - uses: actions/checkout@v2.3.4 + - name: Install dependencies + uses: bahmutov/npm-install@v1.7.1 + 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/package.json b/package.json index 7176106..83336fb 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ ], "repository": "KenanY/secure-random-octet", "license": "MIT", - "author": "Kenan Yildirim (http://kenany.me/)", + "author": "Kenan Yildirim (https://kenany.me/)", "main": "index.js", "files": [ "index.js", @@ -20,6 +20,7 @@ "lint": "eslint *.js test/*.js", "tests-only": "tape test/index.js", "coverage": "nyc npm run -s tests-only", + "release": "semantic-release", "pretest": "npm run -s lint", "test": "npm run -s tests-only" }, @@ -28,12 +29,16 @@ }, "devDependencies": { "@kenan/eslint-config": "^8.0.4", - "@kenan/renovate-config": "1.5.0", + "@kenan/renovate-config": "^1.5.0", + "@semantic-release/changelog": "^5.0.1", + "@semantic-release/git": "^9.0.0", + "conventional-changelog-conventionalcommits": "^4.5.0", "eslint": "^7.23.0", - "lodash.every": "4.6.0", - "lodash.isfunction": "3.0.9", - "lodash.isnumber": "3.0.3", - "nyc": "15.1.0", - "tape": "5.2.2" + "lodash.every": "^4.6.0", + "lodash.isfunction": "^3.0.9", + "lodash.isnumber": "^3.0.3", + "nyc": "^15.1.0", + "semantic-release": "^17.4.2", + "tape": "^5.2.2" } }