Skip to content

v7.1.0-awsv3

v7.1.0-awsv3 #69

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 i @aws-sdk/client-cloudformation@^3.378.0 @aws-sdk/client-dynamodb@^3.378.0 @aws-sdk/client-firehose@^3.378.0 @aws-sdk/client-kinesis@^3.378.0 @aws-sdk/client-s3@^3.378.0 @aws-sdk/client-secrets-manager@^3.378.0 @aws-sdk/client-sts@^3.378.0 @aws-sdk/credential-providers@^3.379.1 @aws-sdk/lib-dynamodb@^3.378.0 @aws-sdk/lib-storage@^3.378.0 @aws-sdk/node-http-handler@^3.374.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}}