diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..5e28ee3 --- /dev/null +++ b/.github/workflows/release.yml @@ -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/cancel-workflow-action@0.12.0 + 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/github-tag-action@v6.0 + 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 "devops@energyweb.org" + 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 diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000..0b32f3e --- /dev/null +++ b/.npmrc @@ -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/ diff --git a/README.md b/README.md index e4036f7..628352f 100644 --- a/README.md +++ b/README.md @@ -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)** diff --git a/package.json b/package.json index 7e4f86f..f186e4d 100644 --- a/package.json +++ b/package.json @@ -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" : { @@ -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" }