diff --git a/.github/workflows/node-release.yml b/.github/workflows/node-release.yml new file mode 100644 index 0000000..ab52bd7 --- /dev/null +++ b/.github/workflows/node-release.yml @@ -0,0 +1,60 @@ +name: Release + +on: + push: + tags: + - '*' + +jobs: + + build-artifact: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@master + + - name: npm pack + run: | + export REPO_NAME=$(echo ${{ github.repository }} | awk -F"/" '{print $2}') + npm pack + cp ${REPO_NAME}*.tgz ${REPO_NAME}-latest.tgz + + - uses: actions/upload-artifact@master + with: + name: artifact-tgz + path: | + ./*.tgz + + - name: Create Release + id: create_release + uses: actions/create-release@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref }} + draft: false + prerelease: false + + - name: Upload Release Asset + id: upload-release-asset + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: ./*.tgz + tag: ${{ github.ref }} + overwrite: true + file_glob: true + + publish-to-npm: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: '16.x' + registry-url: 'https://registry.npmjs.org' + - run: npm ci + - run: npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/node-test.yml b/.github/workflows/node-test.yml new file mode 100644 index 0000000..b7ce16d --- /dev/null +++ b/.github/workflows/node-test.yml @@ -0,0 +1,30 @@ +# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions + +name: Node.js CI + +on: + push: + branches: ["main"] + pull_request: + branches: ["main"] + +jobs: + build: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [12.x, 14.x, 16.x] + # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ + + steps: + - uses: actions/checkout@v3 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + cache: "npm" + - run: npm ci + - run: npm run build --if-present + - run: npm test diff --git a/package.json b/package.json index 4ed9fea..5fff65c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "node-red-contrib-tak", - "version": "4.1.0-beta4", + "version": "4.1.0-beta5", "description": "Node-RED Nodes for encoding & decoding TAK Protocol and Cursor on Target messages from TAK Products.", "license": "Apache-2.0", "url": "https://github.com/snstac/node-red-contrib-tak",