Skip to content

chore: upgrade to wrapscan URIs #16

chore: upgrade to wrapscan URIs

chore: upgrade to wrapscan URIs #16

name: http-plugin-js-cd
on:
pull_request:
types: [closed]
branches:
- main
paths:
- "implementations/js/**"
jobs:
cd:
name: http-plugin-js-cd
if: |
github.event.pull_request.merged &&
startsWith(github.event.pull_request.title, '[CD]') != true &&
github.event.pull_request.user.login != 'github-actions'
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Read .nvmrc
run: echo ::set-output name=NVMRC::$(cat .nvmrc)
id: nvm
working-directory: ./implementations/js
- name: Read VERSION into env.RELEASE_VERSION
working-directory: ./implementations/js
run: |
echo RELEASE_VERSION=$(cat package.json | grep version | head -1 | awk -F: '{ print $2 }' | sed 's/[",]//g') >> $GITHUB_ENV
- name: Is Pre-Release
run: |
STR="${RELEASE_VERSION}"
SUB='pre.'
if [[ "$STR" == *"$SUB"* ]]; then
echo PRE_RELEASE=true >> $GITHUB_ENV
else
echo PRE_RELEASE=false >> $GITHUB_ENV
fi
- name: Setup Node.js
uses: actions/setup-node@master
with:
node-version: '${{ steps.nvm.outputs.NVMRC }}'
- name: Install dependencies
run: yarn install --nonInteractive --frozen-lockfile --prefer-offline
working-directory: ./implementations/js
- name: Build
run: yarn build
working-directory: ./implementations/js
- name: Auth into NPM
run: |
npm config set registry https://registry.npmjs.org/
npm config set //registry.npmjs.org/:_authToken=${{secrets.POLYWRAP_BUILD_BOT_NPM_PAT}}
echo $(npm whoami --registry https://registry.npmjs.org/)
working-directory: ./implementations/js
- name: Publish To NPM (Latest)
if: env.PRE_RELEASE == 'false'
run: yarn publish:npm
working-directory: ./implementations/js
env:
NPM_AUTH_TOKEN: ${{secrets.POLYWRAP_BUILD_BOT_NPM_PAT}}
- name: Publish Node Packages To NPM (Pre-Release)
if: env.PRE_RELEASE == 'true'
run: yarn publish:pre:npm
working-directory: ./implementations/js
env:
NPM_AUTH_TOKEN: ${{secrets.POLYWRAP_BUILD_BOT_NPM_PAT}}