-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
26 changed files
with
3,351 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
{ | ||
"ignorePatterns": [ | ||
"src/**" | ||
], | ||
"extends": [ | ||
"eslint:recommended", | ||
"plugin:node/recommended" | ||
], | ||
"parserOptions": { | ||
"ecmaVersion": 2022 | ||
}, | ||
"env": { | ||
"node": true, | ||
"es6": true | ||
}, | ||
"rules": { | ||
"arrow-parens": ["error", "always"], | ||
"no-trailing-spaces": [ | ||
"error", | ||
{ | ||
"skipBlankLines": true | ||
} | ||
], | ||
"indent": [ | ||
"error", | ||
"tab", | ||
{ | ||
"SwitchCase": 1 | ||
} | ||
], | ||
"operator-linebreak": [ | ||
"error", | ||
"after", | ||
{ | ||
"overrides": { | ||
"?": "before", | ||
":": "before" | ||
} | ||
} | ||
], | ||
"max-len": ["error", 110], | ||
"quotes": [ | ||
"error", | ||
"single" | ||
], | ||
"semi": [ | ||
"error", | ||
"always" | ||
], | ||
"no-multiple-empty-lines": ["error", { "max": 3, "maxEOF": 1, "maxBOF": 1 }], | ||
"keyword-spacing": ["error", { "before": true, "after": true }], | ||
"space-before-blocks": ["error"], | ||
"space-before-function-paren": ["error", {"anonymous": "always", "named": "never", "asyncArrow": "always"}], | ||
"camelcase": ["error"], | ||
"no-tabs": [0], | ||
"global-require": [0], | ||
"no-underscore-dangle": [0], | ||
"no-plusplus": [0], | ||
"no-shadow": [0], | ||
"node/no-unpublished-require": [0], | ||
"no-process-exit": [0], | ||
"linebreak-style": [0], | ||
"node/no-missing-require": [0], | ||
"no-console": [0], | ||
"node/no-unsupported-features/es-builtins": [ | ||
"error", | ||
{ "version": ">=18.16.0" } | ||
], | ||
"node/no-unsupported-features/node-builtins": [ | ||
"error", | ||
{ "version": ">=18.16.0" } | ||
], | ||
"func-names": [ | ||
"error", | ||
"never", | ||
{ | ||
"generators": "never" | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
src/binding.gyp linguist-vendored | ||
src/include/** linguist-vendored |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
name: Build Binaries | ||
defaults: | ||
run: | ||
shell: bash | ||
|
||
on: | ||
workflow_dispatch | ||
|
||
jobs: | ||
create_release: | ||
name: Create Release | ||
if: contains('["raub"]', github.actor) | ||
runs-on: ubuntu-latest | ||
|
||
outputs: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
|
||
steps: | ||
|
||
- name: Fetch Repository | ||
uses: actions/checkout@v4 | ||
with: | ||
persist-credentials: false | ||
|
||
- name: Install Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 18.16.0 | ||
cache: 'npm' | ||
|
||
- name: Get Package Version | ||
id: package-version | ||
run: node -p "'version='+require('./package').version" >> $GITHUB_OUTPUT | ||
|
||
- name: Create Draft Release | ||
id: create_release | ||
uses: softprops/action-gh-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
draft: true | ||
tag_name: ${{ steps.package-version.outputs.version }} | ||
name: Release ${{ steps.package-version.outputs.version }} | ||
body: Binaries at ${{ github.sha }} | ||
|
||
build: | ||
name: Build | ||
strategy: | ||
matrix: | ||
os: [ubuntu-20.04, windows-2022, macos-11, [self-hosted, linux, ARM64]] | ||
|
||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
|
||
- name: Fetch Repository | ||
uses: actions/checkout@v4 | ||
with: | ||
persist-credentials: false | ||
|
||
- name: Install Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 18.16.0 | ||
cache: 'npm' | ||
|
||
- name: Install Modules | ||
run: npm ci | ||
|
||
- name: Fix Python | ||
if: matrix.os == 'macos-11' | ||
run: pip install setuptools | ||
|
||
- name: Build Current Binary | ||
run: npm run build | ||
|
||
- name: Get Package Version | ||
id: package-version | ||
run: node -p "'version='+require('./package').version" >> $GITHUB_OUTPUT | ||
|
||
- name: Pack Files | ||
id: pack-files | ||
run: node -e "require('addon-tools-raub').actionPack()" >> $GITHUB_OUTPUT | ||
|
||
- name: Store Binaries | ||
uses: softprops/action-gh-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
draft: true | ||
tag_name: ${{ steps.package-version.outputs.version }} | ||
name: Release ${{ steps.package-version.outputs.version }} | ||
files: ${{ steps.pack-files.outputs.pack }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: Cpplint | ||
defaults: | ||
run: | ||
shell: bash | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
eslint: | ||
name: Cpplint | ||
runs-on: ubuntu-20.04 | ||
|
||
steps: | ||
|
||
- name: Fetch Repository | ||
uses: actions/checkout@v4 | ||
with: | ||
persist-credentials: false | ||
|
||
- name: Install Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 18.16.0 | ||
cache: 'npm' | ||
|
||
- name: Install Modules | ||
run: npm ci | ||
|
||
- name: Install Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.12' | ||
|
||
- name: Install Cpplint | ||
run: pip install cpplint | ||
|
||
- name: Run Cpplint | ||
run: | | ||
node -e "require('addon-tools-raub').cpcpplint()" | ||
cpplint --recursive ./src/cpp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: ESLint | ||
defaults: | ||
run: | ||
shell: bash | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
eslint: | ||
name: ESLint | ||
runs-on: ubuntu-20.04 | ||
|
||
steps: | ||
|
||
- name: Fetch Repository | ||
uses: actions/checkout@v4 | ||
with: | ||
persist-credentials: false | ||
|
||
- name: Install Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 18.16.0 | ||
cache: 'npm' | ||
|
||
- name: Install Modules | ||
run: npm ci | ||
|
||
- name: Run ESLint | ||
run: npm run eslint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: Publish to NPM | ||
defaults: | ||
run: | ||
shell: bash | ||
|
||
on: | ||
workflow_dispatch | ||
|
||
jobs: | ||
Publish: | ||
if: contains('["raub"]', github.actor) | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
|
||
- name: Fetch Repository | ||
uses: actions/checkout@v4 | ||
with: | ||
persist-credentials: false | ||
|
||
- name: Install Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 18.16.0 | ||
cache: 'npm' | ||
|
||
- name: Get Package Version | ||
id: package-version | ||
run: node -p "'version='+require('./package').version" >> $GITHUB_OUTPUT | ||
|
||
- name: Publish | ||
run: | | ||
npm config set //registry.npmjs.org/:_authToken ${NPM_TOKEN} | ||
npm publish --ignore-scripts | ||
env: | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
|
||
- name: Create Release | ||
id: create_release | ||
uses: softprops/action-gh-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
draft: true | ||
tag_name: ${{ steps.package-version.outputs.version }} | ||
name: Release ${{ steps.package-version.outputs.version }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
name: Test | ||
defaults: | ||
run: | ||
shell: bash | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
unit-tests: | ||
name: Unit Tests | ||
strategy: | ||
matrix: | ||
os: [ubuntu-20.04, windows-2022, macos-11, [self-hosted, linux, ARM64]] | ||
|
||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
|
||
- name: Fetch Repository | ||
uses: actions/checkout@v4 | ||
with: | ||
persist-credentials: false | ||
|
||
- name: Install Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 18.16.0 | ||
cache: 'npm' | ||
|
||
- name: Install Modules | ||
run: npm ci | ||
|
||
- name: Fix Python | ||
if: matrix.os == 'macos-11' | ||
run: pip install setuptools | ||
|
||
- name: Build Current Binary | ||
run: npm run build | ||
|
||
- name: Audio Device - Unix | ||
if: matrix.os == 'ubuntu-20.04' || matrix.os == 'macos-11' | ||
uses: LABSN/sound-ci-helpers@v1 | ||
|
||
- name: Audio Device - Windows | ||
if: matrix.os == 'windows-2022' | ||
shell: powershell | ||
run: | | ||
Start-Service audio* | ||
Invoke-WebRequest https://github.com/duncanthrax/scream/releases/download/3.6/Scream3.6.zip -OutFile C:\Scream3.6.zip | ||
Extract-7Zip -Path C:\Scream3.6.zip -DestinationPath C:\Scream | ||
$cert = (Get-AuthenticodeSignature C:\Scream\Install\driver\Scream.sys).SignerCertificate | ||
$store = [System.Security.Cryptography.X509Certificates.X509Store]::new("TrustedPublisher", "LocalMachine") | ||
$store.Open("ReadWrite") | ||
$store.Add($cert) | ||
$store.Close() | ||
cd C:\Scream\Install\driver | ||
C:\Scream\Install\helpers\devcon install Scream.inf *Scream | ||
- name: Run Unit Tests | ||
if: matrix.os == 'ubuntu-20.04' || matrix.os == 'windows-2022' || matrix.os == 'macos-11' | ||
run: npm test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
.cproject | ||
.idea | ||
.lock-wscript | ||
.DS_Store | ||
.project | ||
.vscode | ||
node_modules/ | ||
src/build/ | ||
src/node_modules/ | ||
bin-*/ | ||
*.log |
Oops, something went wrong.