Skip to content

Commit

Permalink
Merge pull request #490 from nextcloud/feature/release-process
Browse files Browse the repository at this point in the history
  • Loading branch information
juliusknorr authored Aug 10, 2022
2 parents 2dd14cc + bad4e8a commit f099514
Show file tree
Hide file tree
Showing 9 changed files with 1,083 additions and 3,378 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/doc-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Doc Publish

on:
release:
types: [published]

jobs:
publish:
runs-on: ubuntu-latest

name: Publish doc
steps:
- name: Check actor permission level
uses: skjnldsv/check-actor-permission@v2
with:
require: admin

- name: Checkout
uses: actions/checkout@v3

- name: Read package.json node and npm engines version
uses: skjnldsv/read-package-engines-version-actions@v1.2
id: versions
with:
fallbackNode: '^16'
fallbackNpm: '^8'

- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
uses: actions/setup-node@v2
with:
node-version: ${{ steps.versions.outputs.nodeVersion }}

- name: Set up npm ${{ steps.versions.outputs.npmVersion }}
run: npm i -g npm@"${{ steps.versions.outputs.npmVersion }}"

- name: Install dependencies & build
run: |
npm ci
npm run build
npm run build:doc
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist/doc
9 changes: 0 additions & 9 deletions .github/workflows/fix-pr-test.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/node-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node: [ 14, 16, 18 ]
node: [ 16, 18 ]
name: Test Node v${{ matrix.node }}
steps:
- uses: actions/checkout@v3
Expand Down
51 changes: 51 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Publish

on:
release:
types: [published]

jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: 🔒​ Check actor permission level
uses: skjnldsv/check-actor-permission@v2
with:
require: admin

- name: 📥​ Checkout
uses: actions/checkout@v3

- name: 🪄 Read package.json node and npm engines version
uses: skjnldsv/read-package-engines-version-actions@v1.2
id: versions
with:
fallbackNode: '^16'
fallbackNpm: '^8'

- name: 🔧​ Setup Node (NPM Registry)
uses: actions/setup-node@v3
with:
node-version: ${{ steps.versions.outputs.nodeVersion }}
cache: 'npm'
registry-url: 'https://registry.npmjs.org'

- name: 📦 Install dependencies & build
run: |
npm ci
npm run build
- name: 📣 Publish package on NPM
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: 🔧​ Setup Github Registry
uses: actions/setup-node@v3
with:
registry-url: 'https://npm.pkg.github.com'

- name: 📣 Publish package on GPR
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

All notable changes to this project will be documented in this file.

## 2.2.0-next
## 3.0.0 - 2022-05-02
### Changed
- Update dependencies
- Fix rollup build
Expand Down
34 changes: 27 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,12 @@ A simple event bus to communicate between Nextcloud components.

## Installation

```sh
npm install @nextcloud/event-bus --save
```
npm i -S @nextcloud/event-bus

```sh
yarn add @nextcloud/event-bus
```

## Usage
Expand All @@ -31,14 +35,30 @@ unsubscribe('b', h)
```

## Naming convention

To stay consistent, we encourage you to use the following syntax when declaring events

`app-id:object:verb`

### Examples:
- nextcloud:unified-search:closed
- files:file:uploading
- files:file:uploaded
- contacts:contact:deleted
- calendar:event:created
- forms:answer:updated

- `nextcloud:unified-search:closed`
- `files:file:uploading`
- `files:file:uploaded`
- `contacts:contact:deleted`
- `calendar:event:created`
- `forms:answer:updated`

## Development

```sh
npm install

npm run build
npm run test
```

### Requirements

- [Node 16 or higher](https://nodejs.org/en/download/)
- [NPM 8 or higher](https://www.npmjs.com/package/npm)
4 changes: 4 additions & 0 deletions lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ import { EventBus } from "./EventBus"
import { ProxyBus } from "./ProxyBus"
import { SimpleBus } from "./SimpleBus"

export type { EventBus } from './EventBus'
export type { EventHandler } from "./EventHandler";
export type { Event } from "./Event";

export { ProxyBus } from "./ProxyBus"
export { SimpleBus } from "./SimpleBus";

Expand Down
Loading

0 comments on commit f099514

Please sign in to comment.