Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add build and publish action #1420

Closed
wants to merge 16 commits into from
Closed
43 changes: 43 additions & 0 deletions .github/workflows/build-and-publish-next.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Build and publish package to NPM with tag NEXT

on:
push:
branches:
- 'next'

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 14
- run: yarn
- run: yarn build

publish:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 14
registry-url: https://registry.npmjs.org/
- run: yarn
- run: yarn build
- run: yarn publish --access=public --tag=next
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

notify:
needs: publish
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: echo ::set-env name=EMOJI_PACKAGE::$'\xf0\x9f\x93\xa6'
- run: echo ::set-env name=PACKAGE_NAME::$(node -p "require('./package.json').name")
- run: echo ::set-env name=PACKAGE_VERSION::$(node -p "require('./package.json').version")
- run: echo ::set-env name=MESSAGE::"$EMOJI_PACKAGE [$PACKAGE_NAME](https://npmjs.com/package/$PACKAGE_NAME) $PACKAGE_VERSION was published. See a [changelog](https://github.com/codex-team/editor.js/blob/next/docs/CHANGELOG.md)."
- run: curl -X POST ${{ secrets.CODEX_BOT_NOTIFY_EDITORJS_PUBLIC_CHAT }} -d "message=$MESSAGE" -d parse_mode=Markdown -d disable_web_page_preview=true
43 changes: 43 additions & 0 deletions .github/workflows/build-and-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Build and publish package to NPM

on:
push:
branches:
- 'master'

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 14
- run: yarn
- run: yarn build

publish:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 14
registry-url: https://registry.npmjs.org/
- run: yarn
- run: yarn build
- run: yarn publish --access=public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

notify:
needs: publish
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: echo ::set-env name=EMOJI_PACKAGE::$'\xf0\x9f\x93\xa6'
- run: echo ::set-env name=PACKAGE_NAME::$(node -p "require('./package.json').name")
- run: echo ::set-env name=PACKAGE_VERSION::$(node -p "require('./package.json').version")
- run: echo ::set-env name=MESSAGE::"$EMOJI_PACKAGE [$PACKAGE_NAME](https://npmjs.com/package/$PACKAGE_NAME) $PACKAGE_VERSION was published. See a [changelog](https://github.com/codex-team/editor.js/blob/next/docs/CHANGELOG.md)."
- run: curl -X POST ${{ secrets.CODEX_BOT_NOTIFY_EDITORJS_PUBLIC_CHAT }} -d "message=$MESSAGE" -d parse_mode=Markdown -d disable_web_page_preview=true
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ node_modules/*

npm-debug.log
yarn-error.log

dist/
2 changes: 0 additions & 2 deletions dist/editor.js

This file was deleted.

67 changes: 0 additions & 67 deletions dist/editor.js.LICENSE.txt

This file was deleted.

Loading