Skip to content

Commit

Permalink
Merge pull request #3 from midival/release/0.1.0
Browse files Browse the repository at this point in the history
release: 0.1.0
  • Loading branch information
kulak-at authored Feb 3, 2024
2 parents 38a6795 + 9d1b658 commit 8c5239c
Show file tree
Hide file tree
Showing 9 changed files with 744 additions and 692 deletions.
52 changes: 39 additions & 13 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Remove .npmrc
run: rm .npmrc
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: 21
- name: Get yarn cache
id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"
Expand All @@ -26,8 +28,8 @@ jobs:
run: yarn install --frozen-lockfile
- name: Compile
run: yarn compile
- name: Upload dist folder
uses: actions/upload-artifact@v1
- name: Upload artifacts folder
uses: actions/upload-artifact@v3
with:
name: dist
path: dist/
Expand All @@ -39,12 +41,36 @@ jobs:
NPM_TOKEN: ${{secrets.NPM_TOKEN}}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v1
- name: Download math result for job 1
uses: actions/download-artifact@v1
with:
name: dist
- name: Publish
run: npm publish --access public
- name: Publish tag
run: hub release create -m "`node -p "require('./package.json').version"`" `node -p "require('./package.json').version"`
- uses: actions/checkout@v1
- name: Download dist
uses: actions/download-artifact@v1
with:
name: dist
- name: Check if version has been updated
id: check
uses: EndBug/version-check@v2
- name: Set Token
run: npm config set //registry.npmjs.org/:_authToken=$NPM_TOKEN
- name: Publish
if: steps.check.outputs.changed == 'true'
run: npm publish --access public
# github-release:
# runs-on: ubuntu-latest
# permissions:
# contents: write
# needs: publish
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# steps:
# - uses: actions/checkout@v1
# - name: Check if version has been updated
# id: check
# uses: EndBug/version-check@v2
# - name: Tag
# if: steps.check.outputs.changed == 'true'
# run: |
# git tag `cat package.json | jq -r '.version'`
# git push origin --tags
# - name: Release
# if: steps.check.outputs.changed == 'true'
# uses: softprops/action-gh-release@v1
86 changes: 41 additions & 45 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,57 +9,53 @@ jobs:
build-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Remove .npmrc
run: rm .npmrc
- name: Get yarn cache
id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/checkout@v1
- name: Get yarn cache
id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"

- uses: actions/cache@v1
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install node_modules
run: yarn install --frozen-lockfile
- name: Compile
run: yarn docs
- name: Upload docs folder
uses: actions/upload-artifact@v1
with:
name: docs
path: docs/
- uses: actions/cache@v1
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install node_modules
run: yarn install --frozen-lockfile
- name: Compile
run: yarn docs
- name: Upload docs folder
uses: actions/upload-artifact@v1
with:
name: docs
path: docs/

publish-docs:
runs-on: ubuntu-latest
needs: build-docs
env:
NPM_TOKEN: ${{secrets.NPM_TOKEN}}
steps:
- uses: actions/checkout@v1
- name: Remove .npmrc
run: rm .npmrc
- name: Get yarn cache
id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/checkout@v1
- name: Get yarn cache
id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"

- uses: actions/cache@v1
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install node_modules
run: yarn install --frozen-lockfile
- name: Download math result for job 1
uses: actions/download-artifact@v1
with:
name: docs
- name: Deploy with gh-pages
run: |
git remote set-url origin https://git:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
npx gh-pages -d docs -u "github-actions-bot <support+actions@github.com>"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/cache@v1
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install node_modules
run: yarn install --frozen-lockfile
- name: Download math result for job 1
uses: actions/download-artifact@v1
with:
name: docs
- name: Deploy with gh-pages
run: |
git remote set-url origin https://git:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
npx gh-pages -d docs -u "github-actions-bot <support+actions@github.com>"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
71 changes: 33 additions & 38 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,46 +6,41 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Remove .npmrc
run: rm .npmrc
- name: Get yarn cache
id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/checkout@v1
- name: Get yarn cache
id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"

- uses: actions/cache@v1
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install node_modules
run: yarn install --frozen-lockfile
- name: Run tests
run: yarn test
- uses: actions/cache@v1
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install node_modules
run: yarn install --frozen-lockfile
- name: Run tests
run: yarn test
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Remove .npmrc
run: rm .npmrc
- name: Get yarn cache
id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"

- uses: actions/cache@v1
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install node_modules
run: yarn install --frozen-lockfile
- name: Compile
run: yarn compile
- name: Upload dist folder
uses: actions/upload-artifact@v1
with:
name: dist
path: dist/
- uses: actions/checkout@v1
- name: Get yarn cache
id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"

- uses: actions/cache@v1
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install node_modules
run: yarn install --frozen-lockfile
- name: Compile
run: yarn compile
- name: Upload dist folder
uses: actions/upload-artifact@v1
with:
name: dist
path: dist/
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ dist/
node_modules/
docs/
coverage/
yarn-error.log
1 change: 0 additions & 1 deletion .npmrc

This file was deleted.

25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# @midival/node

This is a node wrapper for `@midial/core` library. It provides MIDI bindings to make library run in the Node.js environment.

For instructions on how to use MIDIVal, please check:
- [the official documentation](https://midival.github.io/)
- [`@midival/core` repository](https://github.com/midival/core)


## How to setup MIDIVal in Node 1-0-1
```ts
import { MIDIVal } from "@midival/core";
import { NodeMIDIAccess } from "@midival/node";
import * as midi from "midi";

MIDIVal.configureAccessObject(new NodeMIDIAccess(midi));

// The rest code should be the same as core examples.

```


# Releases
## [0.1.0]
- Release compatible with `0.1.x` versions of `@midival/core`.
20 changes: 10 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
{
"name": "@midival/node",
"version": "0.0.6",
"version": "0.1.0",
"main": "dist/index.js",
"repository": "git@github.com:midival/node.git",
"author": "Kacper Kula <kulak@kulak.at>",
"license": "MIT",
"devDependencies": {
"@midival/core": "^0.0.17",
"@types/jest": "^28.1.1",
"@types/midi": "^2.0.0",
"@types/node": "^17.0.42",
"jest": "^28.1.1",
"ts-jest": "^28.0.5",
"typedoc": "^0.22.17",
"typescript": "^4.7.3"
"@midival/core": "^0.1.6",
"@types/jest": "^29.5.12",
"@types/midi": "^2.0.3",
"@types/node": "^20.11.16",
"jest": "^29.7.0",
"ts-jest": "^29.1.2",
"typedoc": "^0.25.7",
"typescript": "^5.3.3"
},
"peerDependencies": {
"@midival/core": "^0.0.17",
Expand All @@ -26,6 +26,6 @@
"deploy": "gh-pages -d docs"
},
"dependencies": {
"@hypersphere/omnibus": "^0.0.6"
"@hypersphere/omnibus": "^0.1.4"
}
}
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es2015",
"target": "ES2020",
"declaration": true,
"outDir": "./dist",
"moduleResolution": "node"
Expand Down
Loading

0 comments on commit 8c5239c

Please # to comment.