Skip to content

v6.0.26-alpha

v6.0.26-alpha #71

Workflow file for this run

# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages
name: NPM Publish Package
on:
release:
types: [ published ]
jobs:
publish-npm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm i aws-sdk@^2.581.0
- run: npm run compile --if-present
- run: npm run coverage-all
- name: Extract Version from Git Tag
shell: bash
run: echo "##[set-output name=version;]$(echo ${GITHUB_REF#refs/tags/v})"
id: extract_version
- name: Extract npm Tag from Tag Tag
shell: bash
run: echo "##[set-output name=tag;]$(echo ${GITHUB_REF#refs/tags/v*-})"
id: extract_tag
- run: echo ref ${{github.ref}}
- run: echo version ${{steps.extract_version.outputs.version}}
- run: echo tag ${{steps.extract_tag.outputs.tag}}
- run: npm version ${{steps.extract_version.outputs.version}} --no-git-tag-version --allow-same-version
- if: steps.extract_tag.outputs.tag == github.ref
run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
- if: steps.extract_tag.outputs.tag != github.ref
run: npm publish --tag ${{steps.extract_tag.outputs.tag}}
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}