diff --git a/.drone.yml b/.drone.yml deleted file mode 100644 index a2f910c2..00000000 --- a/.drone.yml +++ /dev/null @@ -1,28 +0,0 @@ -kind: pipeline -name: default - -steps: - - name: node_modules - image: node:10.14 - commands: - - npm install --no-progress --quiet --unsafe-perm > npm-install.log - - - name: develop:build - image: node:10.14 - commands: - - npm run build - when: - branch: - - develop - - master - - enhancement/ci - - - name: slack - image: plugins/slack - settings: - webhook: - from_secret: SLACK_WEBHOOK_URL - channel: log_github - username: Drone CI - when: - status: [success, failure] diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000..a5a0549b --- /dev/null +++ b/.editorconfig @@ -0,0 +1,13 @@ + +root = true + +[*] +indent_style = space +indent_size = 2 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.md] +trim_trailing_whitespace = false \ No newline at end of file diff --git a/.github/workflows/build_and_publish.yml b/.github/workflows/build_and_publish.yml new file mode 100644 index 00000000..c89f93c0 --- /dev/null +++ b/.github/workflows/build_and_publish.yml @@ -0,0 +1,58 @@ +name: Build & Publish + +on: + push: + branches: + - master + - develop + pull_request: + branches: + - '*' + +env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} + +jobs: + build_and_publish: + runs-on: ubuntu-latest + steps: + - name: Checkout Repo + uses: actions/checkout@master + + - name: Setup Node.js + uses: actions/setup-node@v2-beta + with: + node-version: '12.16' + + - name: Cache Dependencies + id: cache + uses: actions/cache@v2 + with: + path: ~/.npm + key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-node- + + - name: Install Dependencies + run: npm ci + + - name: Test + run: npm run lint + + - name: Build + run: npm run build + + # === `master` branch === + - name: Publish to NPM + if: github.ref == 'refs/heads/master' + run: npm publish --access public + + - name: Slack Notification + if: always() + uses: 8398a7/action-slack@v3 + with: + status: ${{ job.status }} + author_name: matters-editor + fields: repo,message,commit,author,action,eventName,ref,workflow,job,took diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..9d4df12f --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,37 @@ +name: Create Release + +on: + push: + branches: + - master + +env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} + +jobs: + release: + runs-on: ubuntu-latest + steps: + - name: Checkout Repo + uses: actions/checkout@master + + - name: Get Version + id: version + uses: martinbeentjes/npm-get-version-action@master + + - name: Create Release + uses: actions/create-release@v1 + with: + tag_name: v${{ steps.version.outputs.current-version}} + release_name: v${{ steps.version.outputs.current-version}} + draft: false + prerelease: false + + - name: Slack Notification + if: always() + uses: 8398a7/action-slack@v3 + with: + status: ${{ job.status }} + author_name: matters-editor + fields: repo,message,commit,author,action,eventName,ref,workflow,job,took diff --git a/package-lock.json b/package-lock.json index a315f740..ffc8a0c2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@matters/matters-editor", - "version": "0.1.13", + "version": "0.1.14", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index e2ba4278..600c7b8b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@matters/matters-editor", - "version": "0.1.13", + "version": "0.1.14", "description": "The editor component.", "author": "Matters Lab", "homepage": "https://github.com/thematters/matters-editor", @@ -20,7 +20,7 @@ "build": "rimraf build/**/* && rollup -c rollup.config.js", "demo": "parcel -p 9000 demo/index.html --open", "format": "prettier --write \"{src,demo}/**/*.{ts,tsx,json}\"", - "tslint": "tslint -p ." + "lint": "tslint -p ." }, "husky": { "hooks": { diff --git a/readme.md b/readme.md index cbf6159a..f7d2fa95 100644 --- a/readme.md +++ b/readme.md @@ -1,5 +1,7 @@ # Matters Editor +![](https://github.com/thematters/matters-editor/workflows/Build%20&%20Publish/badge.svg) ![](https://github.com/thematters/matters-editor/workflows/Create%20Release/badge.svg) + This rich text editor is based on three amazing projects [Quill](https://quilljs.com/), [react-quill](https://github.com/zenoamaro/react-quill) and [Tippy.js](https://atomiks.github.io/tippyjs/). This editor has been used in a real production called [Matters](http://matters.news), a writing platform built on top of IPFS. Currently, we're pulling it out as a standalone package, so there will be some big changes in the following. 😎 ## Features