Skip to content

Commit

Permalink
Merge pull request #133 from thematters/feature/github-actions
Browse files Browse the repository at this point in the history
GitHub Actions replaces Drone CI to build, publish & release
  • Loading branch information
robertu7 authored Jun 19, 2020
2 parents 06c5740 + ce026df commit 61309e7
Show file tree
Hide file tree
Showing 7 changed files with 113 additions and 31 deletions.
28 changes: 0 additions & 28 deletions .drone.yml

This file was deleted.

13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -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
58 changes: 58 additions & 0 deletions .github/workflows/build_and_publish.yml
Original file line number Diff line number Diff line change
@@ -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
37 changes: 37 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -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": {
Expand Down
2 changes: 2 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 61309e7

Please sign in to comment.