Skip to content

Addresses #95 identified inconsistancy with msg.platform output #8

Addresses #95 identified inconsistancy with msg.platform output

Addresses #95 identified inconsistancy with msg.platform output #8

Workflow file for this run

name: release
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
env:
NODEVERSION: "16"
NODEREGISTRY: "https://registry.npmjs.org"
APP: "node-red-contrib-castv2"
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
ref: master
fetch-depth: 0
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODEVERSION }}
registry-url: ${{ env.NODEREGISTRY }}
- name: Get version
id: version
run: echo "version-without-v=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
- name: Get previous release tag
id: previousTag
run: |
PREV_REV=$(git rev-list --tags --max-count=1 --skip=1 --no-walk)
PREV_TAG=$(git describe --tags ${PREV_REV})
echo "tag=${PREV_TAG}" >> $GITHUB_OUTPUT
- name: Run NPM Install
run: npm install
- name: Set version
run: npm --no-git-tag version ${{ steps.version.outputs.version-without-v }}
- name: Build package
run: npm pack
- name: Upload app build artifact
uses: actions/upload-artifact@v3
with:
name: ${{ env.APP }}-${{ steps.version.outputs.version-without-v }}
path: ${{ env.APP }}-${{ steps.version.outputs.version-without-v }}.tgz
- name: GitHub release
id: release
run: gh release create ${{ github.ref }} "${{ env.APP }}-${{ steps.version.outputs.version-without-v }}.tgz" -t "${{ steps.version.outputs.version-without-v }}" --generate-notes --notes-start-tag ${{ steps.previousTag.outputs.tag }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Publish
id: publish
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- if: steps.publish.outputs.type != 'none'
name: Update Node-Red flow-library
uses: Zehir/update-package-node-red-flow-library-action@v1.0.5
continue-on-error: true
with:
package-name: ${{ env.APP }}