Skip to content

Commit

Permalink
update github workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
oleh-poberezhets committed Jan 22, 2020
1 parent f4ccccc commit 198e04c
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion .github/workflows/npm_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,29 @@ on:
types: [published, edited]

jobs:
check:
name: Check version and tag
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Get package version
shell: bash
id: package_version
run: |
ver=$(jq .version package.json | sed -e "s/^\"//" -e "s/\"//")
echo "::set-output name=version::$ver"
- name: Compare package version and release tag
if: steps.package_version.outputs.version != github.event.release.tag_name
env:
TAG: "${{ github.event.release.tag_name }}"
PKG_VER: ${{ steps.package_version.outputs.version }}
run: |
echo "Mismatch NPM version $PKG_VER and git tag $TAG"
exit 1
build:
name: Lint and test
needs: check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
Expand All @@ -19,7 +40,7 @@ jobs:

publish-npm:
name: Publish to NPM
needs: build
needs: [check, build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
Expand Down

0 comments on commit 198e04c

Please sign in to comment.