Skip to content

Commit

Permalink
update version + npm publish to auto update package.json version on p…
Browse files Browse the repository at this point in the history
…ublish (#72)
  • Loading branch information
armand-janssen authored Oct 14, 2023
1 parent a0e9468 commit 8cae10d
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 18 deletions.
40 changes: 23 additions & 17 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,31 @@
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages

name: Publish Package
name: Publish to npm

on:
release:
types: [published]

jobs:
build:
name: Build and publish
publish:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
registry-url: 'https://registry.npmjs.org'
- run: npm ci
- run: npm run build --if-present
- run: npm test
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
- name: Checkout code
uses: actions/checkout@v4

- uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
registry-url: 'https://registry.npmjs.org'

- name: Install dependencies
run: npm ci

- name: Bump version and push to GitHub
run: |
npm version patch # Increment the version number (you can use "minor" or "major" instead of "patch" if needed)
git commit -am "Bump version for release"
git push
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "openapi-transformer",
"version": "0.8.0",
"version": "0.11.0",
"description": "Transforms OpenAPI Schemas to other formats like MarkDown and PlantUML",
"main": "index.js",
"repository": {
Expand Down

0 comments on commit 8cae10d

Please sign in to comment.