Skip to content

Commit

Permalink
Merge pull request #4 from energywebfoundation/prepare_release
Browse files Browse the repository at this point in the history
Prepare release
  • Loading branch information
vickenliu authored May 6, 2024
2 parents 0c703d9 + 88a4a74 commit ecad621
Show file tree
Hide file tree
Showing 4 changed files with 86 additions and 4 deletions.
67 changes: 67 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: NPM Publish

on:
push:
branches:
- master

env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

jobs:
cancel-previous:
name: 'Cancel Previous Runs'
runs-on: ubuntu-latest
timeout-minutes: 3
steps:
- uses: styfle/[email protected]
with:
access_token: ${{ github.token }}

semantic-version:
name: Semantic release
runs-on: ubuntu-latest
needs: [cancel-previous]
timeout-minutes: 2
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Bump version and push tag
id: tag_version
uses: mathieudutour/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
custom_release_rules: major:major:Major Changes,minor:minor:Minor Changes,chore:patch:Chores
outputs:
new_version: ${{ steps.tag_version.outputs.new_version }}

publish:
runs-on: ubuntu-latest
timeout-minutes: 10
needs: [cancel-previous, semantic-version]

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: 21.2.0

- name: Install dependencies
run: npm ci

- name: Bump package version
run: |
git config user.email "[email protected]"
git config user.name "ewf-devops"
npm version "${{ needs.semantic-version.outputs.new_version }}"
- name: Publish to NPM
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} # Set your NPM token in repository secrets
run: npm publish --access public # Add any additional flags you need
7 changes: 7 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
registry=https://registry.npmjs.org/

# Authentication token for publishing packages
//registry.npmjs.org/:_authToken=${NPM_TOKEN}

# Use a scoped registry for a specific scope
@energyweb:registry=https://registry.npmjs.org/
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Have your node-red flows to become SmartFlows by being installed, executed and reach consensus across thousands of decentralised worker nodes around the world.

Screenshot:
![alt text](https://github.com/energywebfoundation/node-red-contrib-energywebx/blob/master/assets/screenshot.png)
![flows screenshot](https://github.com/energywebfoundation/node-red-contrib-energywebx/raw/master/assets/screenshot.png)

## Nodes
**Submit Results (WIP)**
Expand Down
14 changes: 11 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "red-contrib-energywebx",
"version": "1.0.0",
"name": "@energyweb/node-red-contrib-energywebx",
"version": "0.0.1-beta",
"description": "Turn your flows to become SmartFlows in-order to be able to have your node-red flows being instaled and executed on tousands of decentralised worker nodes around the world (Powered by EnergyWebX)",
"main": "index.js",
"node-red" : {
Expand Down Expand Up @@ -31,10 +31,18 @@
"Nodes",
"Decentralised",
"Blockchain",
"EWT"
"EWT",
"node-red"
],
"author": "EnergyWebX",
"license": "ISC",
"repository": {
"type": "git",
"url": "https://github.com/energywebfoundation/node-red-contrib-energywebx"
},
"bugs": {
"url": "https://github.com/energywebfoundation/node-red-contrib-energywebx/issues"
},
"dependencies": {
"request-promise": "^4.2.6"
}
Expand Down

0 comments on commit ecad621

Please sign in to comment.