Skip to content

Commit

Permalink
Merge pull request #37 from JamesBrill/fix-ci-2
Browse files Browse the repository at this point in the history
Only publish on release creation
  • Loading branch information
JamesBrill authored Jun 26, 2020
2 parents 186a64b + b951375 commit b381e98
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 24 deletions.
24 changes: 3 additions & 21 deletions .github/workflows/ci.yml → .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,10 @@
name: CI
name: Publish

on:
push:
branches:
- master
tags-ignore:
- v*
release:
types: [created]

jobs:
bump-version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12
- run: git config --global user.name 'james.brill'
- run: git config --global user.email 'contact@jamesbrill.co.uk'
- run: npm version patch -m "v%s"
- run: git push --tags
- run: git push
env:
GITHUB_TOKEN: ${{secrets.PAT}}

publish-npm:
needs: bump-version
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-speech-recognition",
"version": "2.1.0",
"version": "2.1.1",
"description": "A React component that converts speech from the microphone to text.",
"main": "lib/index.js",
"scripts": {
Expand All @@ -9,7 +9,8 @@
"update-example": "cp -R src/ example/src/SpeechRecognition",
"run-example": "cd example && npm i && npm start",
"dev": "npm run watch & npm run update-example && npm run run-example",
"watch": "npm-watch update-example"
"watch": "npm-watch update-example",
"bump": "npm version patch -m \"v%s\" && git push --tags"
},
"watch": {
"update-example": "src/*.js"
Expand Down

0 comments on commit b381e98

Please sign in to comment.