-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* working on nodered node * working on nodered node * automatically sync version between python and js * add ruff cache to .gitignore * add check for nodejs and python version sync * add additional check for version matching * refactor bindings into two projects: js bindings and nodered module * refactor bindings into two projects: js bindings and nodered module * working on nodered node * automatically sync version between python and js * add ruff cache to .gitignore * add check for nodejs and python version sync * add additional check for version matching * fix bad path * publish node-red package to npm
- Loading branch information
Showing
11 changed files
with
315 additions
and
16 deletions.
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
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 |
---|---|---|
|
@@ -22,13 +22,17 @@ jobs: | |
# Update the version file (version.py) | ||
sed -i "s/__version__ = \".*\"/__version__ = \"$TAG\"/" src/hvps/version.py | ||
# Update the package.json file | ||
sed -i "s/\"version\": \".*\",/\"version\": \"$TAG\",/" bindings/nodejs/package.json | ||
# Update the package.json file for bindings | ||
sed -i "s/\"version\": \".*\",/\"version\": \"$TAG\",/" bindings/nodejs/hvps/package.json | ||
# Update the package.json file for nodered | ||
sed -i "s/\"version\": \".*\",/\"version\": \"$TAG\",/" bindings/nodejs/nodered/package.json | ||
sed -i "s/\"hvps\": \".*\",/\"version\": \"$TAG\",/" bindings/nodejs/nodered/package.json | ||
# Commit and push changes | ||
git config --local user.name "Luis Antonio Obis Aparicio" | ||
git config --local user.email "[email protected]" | ||
git add src/hvps/version.py bindings/nodejs/package.json | ||
git add src/hvps/version.py bindings/nodejs/hvps/package.json bindings/nodejs/nodered/package.json | ||
git commit -m "Update version to $TAG" | ||
git push origin HEAD:main | ||
|
@@ -74,7 +78,7 @@ jobs: | |
- name: Verify npm package version matches tag | ||
run: | | ||
python -c "import os,json;version=json.load(open('bindings/nodejs/package.json'))['version'];assert '${{ github.event.release.tag_name }}' == 'v' + version" | ||
python -c "import os,json;version=json.load(open('bindings/nodejs/hvps/package.json'))['version'];assert '${{ github.event.release.tag_name }}' == 'v' + version" | ||
- name: Cache dist directory | ||
uses: actions/cache@v3 | ||
|
@@ -98,12 +102,40 @@ jobs: | |
user: __token__ | ||
password: ${{ secrets.PYPI_API_TOKEN }} | ||
|
||
publish-to-npm: | ||
publish-bindings-to-npm: | ||
needs: [ publish-to-pypi ] | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: bindings/nodejs/hvps | ||
|
||
steps: | ||
- name: restore source code from cache (contains update to version) | ||
uses: actions/cache@v3 | ||
with: | ||
path: ${{ github.workspace }} | ||
key: ${{ runner.os }}-src-${{ github.sha }}-${{ github.run_id}}-${{ github.run_number }} | ||
|
||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
cache: 'npm' | ||
registry-url: 'https://registry.npmjs.org' | ||
|
||
- name: Install dependencies | ||
run: npm ci | ||
|
||
- name: Publish to npm | ||
run: npm publish | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
|
||
publish-node-to-npm: | ||
needs: [ publish-to-pypi ] | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: bindings/nodejs | ||
working-directory: bindings/nodejs/nodered | ||
|
||
steps: | ||
- name: restore source code from cache (contains update to version) | ||
|
@@ -116,7 +148,6 @@ jobs: | |
with: | ||
node-version: 18 | ||
cache: 'npm' | ||
cache-dependency-path: bindings/nodejs/package-lock.json | ||
registry-url: 'https://registry.npmjs.org' | ||
|
||
- name: Install dependencies | ||
|
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions
4
bindings/nodejs/package-lock.json → bindings/nodejs/hvps/package-lock.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
File renamed without changes.
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,26 @@ | ||
<script type="text/javascript"> | ||
RED.nodes.registerType('hvps', { | ||
category: 'function', | ||
color: '#a6bbcf', | ||
defaults: { | ||
name: {value: ""} | ||
}, | ||
inputs: 1, | ||
outputs: 1, | ||
icon: "file.png", | ||
label: function () { | ||
return this.name || "hvps"; | ||
} | ||
}); | ||
</script> | ||
|
||
<script type="text/html" data-template-name="lower-case"> | ||
<div class="form-row"> | ||
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label> | ||
<input type="text" id="node-input-name" placeholder="Name"> | ||
</div> | ||
</script> | ||
|
||
<script type="text/html" data-help-name="lower-case"> | ||
<p>TODO</p> | ||
</script> |
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,14 @@ | ||
import { ExecutionContext } from "hvps"; | ||
|
||
module.exports = function (RED) { | ||
function HVPS(config) { | ||
RED.nodes.createNode(this, config); | ||
const node = this; | ||
node.on('input', function (msg) { | ||
msg.payload = msg.payload.toLowerCase(); | ||
node.send(msg); | ||
}); | ||
} | ||
|
||
RED.nodes.registerType("hvps", HVPS); | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.