-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #60 from LCMApps/add-github-action-for-npm-releases
Add GitHub action for NPM releases
- Loading branch information
Showing
7 changed files
with
408 additions
and
183 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
name: NPM Release | ||
|
||
on: | ||
release: | ||
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 | ||
- uses: actions/setup-node@v1 | ||
with: | ||
node-version: 12 | ||
- run: yarn install --frozen-lock-file | ||
- run: yarn lint | ||
- run: yarn tests | ||
|
||
publish-npm: | ||
name: Publish to NPM | ||
needs: [check, build] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- uses: actions/setup-node@v1 | ||
with: | ||
node-version: 12 | ||
registry-url: https://registry.npmjs.org/ | ||
- run: yarn install --frozen-lock-file | ||
- run: yarn publish | ||
env: | ||
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,11 @@ | ||
# Changelog | ||
|
||
### 1.0.4 | ||
|
||
IMPROVEMENTS: | ||
|
||
- Dependencies was bumped | ||
|
||
### 1.0.3 | ||
|
||
IMPROVEMENTS: | ||
|
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
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
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
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
Oops, something went wrong.