Skip to content

Commit

Permalink
fix: Automatically increment npm version in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
alesancor1 committed Sep 23, 2021
1 parent 9260ac5 commit 907adfc
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
17 changes: 16 additions & 1 deletion .github/workflows/nodejs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
# github-token: ${{ secrets.GITHUB_TOKEN }}
# env:
# CI: true
npmRelease:
npmReleaseMain:
name: Publish new release to npm registry
runs-on: ubuntu-latest
if: ${{ github.ref == 'refs/heads/main' && github.event_name == 'push'}}
Expand All @@ -50,9 +50,24 @@ jobs:
node-version: '14.x'
registry-url: 'https://registry.npmjs.org'
- run: npm install
- run: npm version minor --git-tag-version false
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- run: git push
npmReleaseDev:
name: Publish new release to npm registry
runs-on: ubuntu-latest
if: ${{ github.ref == 'refs/heads/develop' && github.event_name == 'push'}}
needs: test
steps:
- uses: actions/checkout@v2
- run: npm install
- run: npm version patch --git-tag-version false
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- run: git push
githubRelease:
name: Release new version to GitHub
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.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "governify-commons",
"version": "1.16.2",
"version": "1.16.1",
"description": "Governify Commons used for Governify microservices",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit 907adfc

Please sign in to comment.