diff --git a/.github/workflows/npm-publish.yaml b/.github/workflows/npm-publish.yaml index 46318af..565dfe0 100644 --- a/.github/workflows/npm-publish.yaml +++ b/.github/workflows/npm-publish.yaml @@ -1,30 +1,34 @@ -name: Publish Package to npm +name: Publish ibm-segment on: push: - tags: - - 'v*' + branches: + - github-actions jobs: build: runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 + with: + persist-credentials: true - - name: Use Node.js - uses: actions/setup-node@v2 - with: - node-version: '14' - registry-url: 'https://registry.npmjs.org/' + # Setup .npmrc file to publish to npm + - uses: actions/setup-node@v3 + with: + node-version: "18.x" + registry-url: "https://registry.npmjs.org" - - name: Install dependencies - run: npm ci + - run: npm ci - - name: Build - run: npm run build + # increment the patch version and commit the change + - name: Bump version and push + run: | + git config user.name github-actions + git config user.email github-actions@github.com + npm version patch -m "chore: bump version to %s" + git push - - name: Publish to npm - run: npm publish - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + - run: npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/package-lock.json b/package-lock.json index 0d684b1..645a2e7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "ibm-segment", - "version": "1.1.5", + "version": "1.1.8", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "ibm-segment", - "version": "1.1.5", + "version": "1.1.8", "license": "ISC", "dependencies": { "@tsconfig/node14": "^14.1.0", diff --git a/package.json b/package.json index 0d82b66..ff485f2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ibm-segment", - "version": "1.1.5", + "version": "1.1.8", "type": "module", "description": "", "main": "dist/index.js",