Merge pull request #314 from divyadaglia-unbxd/vulnerability_moderate #375
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: NPM | |
on: | |
pull_request: | |
push: | |
branches: | |
- master | |
- feature-* | |
- develop | |
env: | |
CODECOV_TOKEN: '${{ secrets.CODECOV_TOKEN }}' | |
GITHUB_TOKEN: '${{ secrets.REACT_GITHUB_TOKEN }}' | |
NPM_TOKEN_REACT_SDK: '${{ secrets.NPM_TOKEN_REACT_SDK }}' | |
NPM_TOKEN: '${{ secrets.NPM_TOKEN }}' | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
test: | |
name: Test 🧪 | |
runs-on: ubuntu-latest | |
steps: | |
- name: Pre-reqs | |
uses: actions/checkout@v2 | |
- name: Setup node | |
uses: actions/setup-node@v2 | |
with: | |
node-version: 16.14.0 | |
- name: Check Cache | |
uses: actions/cache@v2 | |
with: | |
path: '**/node_modules' | |
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }} | |
- name: Install Dependencies | |
run: yarn install | |
- name: Run Test | |
run: yarn test | |
release: | |
name: Release | |
needs: test | |
if: github.event_name == 'push' && github.ref == 'refs/heads/master' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Pre-reqs | |
uses: actions/checkout@v2 | |
- name: Setup node | |
uses: actions/setup-node@v2 | |
with: | |
node-version: 16.14.0 | |
- name: Check Cache | |
uses: actions/cache@v2 | |
with: | |
path: '**/node_modules' | |
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }} | |
- name: Install Dependencies | |
run: yarn install --frozen-lockfile | |
- name: Run Build | |
run: yarn build | |
- name: Extract version | |
id: extract_version | |
uses: Saionaro/extract-package-version@v1.0.6 | |
- name: Print version | |
run: echo ${{ steps.extract_version.outputs.version }} | |
- name: Publish package | |
uses: JS-DevTools/npm-publish@v1 | |
with: | |
token: ${{ secrets.NPM_TOKEN_REACT_SDK }} | |
- name: Slack Notification | |
uses: rtCamp/action-slack-notify@v2 | |
if: always() | |
env: | |
SLACK_WEBHOOK: ${{ secrets.PLATFORM_SLACK_WEBHOOK_URL }} | |
SLACK_USERNAME: "React SDK" | |
SLACK_MSG_AUTHOR: ${{ github.actor }} | |
SLACK_CHANNEL: '#ss-builds' | |
SLACK_COLOR: ${{ job.status }} | |
SLACK_ICON: https://github.com/rtCamp.png?size=48 | |
SLACK_TITLE: Image | |
SLACK_MESSAGE: ${{ steps.extract_version.outputs.version }} | |