Skip to content

chore(deps): bump ua-parser-js in /examples/complete/react-native (#1… #86

chore(deps): bump ua-parser-js in /examples/complete/react-native (#1…

chore(deps): bump ua-parser-js in /examples/complete/react-native (#1… #86

Workflow file for this run

name: NPM Package Publish
on:
push:
branches:
- master
- next
- alpha
jobs:
publish-npm:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Check if version has been updated
id: check
uses: EndBug/version-check@v1
- name: Setup Node 10
if: steps.check.outputs.changed == 'true'
uses: actions/setup-node@v1
with:
node-version: 10
registry-url: https://registry.npmjs.org/
# Setup dependency caching
- uses: actions/cache@v1
if: steps.check.outputs.changed == 'true'
with:
path: ~/.npm
key: ${{ runner.os }}-npm-${{ hashFiles('package-lock.json') }}
- name: Install Dependencies
if: steps.check.outputs.changed == 'true'
run: npm ci
- name: Check For Lint
if: steps.check.outputs.changed == 'true'
run: npm run lint
- name: Run Unit Tests + Coverage
if: steps.check.outputs.changed == 'true'
env:
CODE_CLIMATE: ${{ secrets.CODE_CLIMATE }}
run: npm run test:cov
- name: Publish
if: steps.check.outputs.changed == 'true'
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_REF: ${{ github.ref }}
run: |
gitBranch=${GITHUB_REF##*/}
publishFlag=$(if [ "$GITHUB_REF" != 'refs/heads/master' ]; then eval echo '--tag $gitBranch'; else echo ''; fi;)
echo "PACKAGE_VERSION=$(cat package.json | jq -r '.version')" >> $GITHUB_ENV
npm publish $publishFlag
- name: Upload Coverage
if: steps.check.outputs.changed == 'true'
env:
CODE_COV: ${{ secrets.CODE_COV }}
# Upload to Code Cover. Curl used in place of codecov/codecov-action
# due to long build time. See https://github.com/codecov/codecov-action/issues/21
run: curl -s https://codecov.io/bash | bash -s -- -t $CODE_COV
- name: Create Release
if: github.ref == 'refs/heads/master' && steps.check.outputs.changed == 'true'
id: create_release
uses: actions/create-release@latest
env:
GITHUB_TOKEN: ${{ github.token }}
with:
tag_name: v${{ env.PACKAGE_VERSION }}
release_name: v${{ env.PACKAGE_VERSION }}
draft: false
prerelease: false