From 077ccc8f9618caa390ae0b2c8707a1cdcf25575f Mon Sep 17 00:00:00 2001 From: cp-dharti-r Date: Thu, 11 Jan 2024 14:38:51 +0530 Subject: [PATCH] Fix publish file flow --- .github/workflows/publish.yml | 30 +++++++++++++++++------------- react/package.json | 2 +- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index c8206ec..c302a92 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -2,8 +2,8 @@ name: Publish Package to npmjs on: push: - branches: - - main + # branches: + # - main jobs: vue-publish: @@ -21,19 +21,21 @@ jobs: # Check if the vue-file-upload version already exists on npm - name: Check Version Existence - id: check_version + id: check_vue_version run: | if npm show @canopassoftware/vue-file-upload@1.0.8; then echo "Version already published. Skipping npm publish." - echo "::set-output name=skip_publish::true" + echo "::set-output name=skip_vue_publish::true" else - echo "::set-output name=skip_publish::false" + echo "::set-output name=skip_vue_publish::false" fi # Publish only if the vue-file-upload version check passed - name: Publish to npm - if: steps.check_version.outputs.skip_publish != true - run: npm publish --access public + if: steps.check_vue_version.outputs.skip_vue_publish != true + run: | + cd vue + npm publish --access public env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} @@ -52,18 +54,20 @@ jobs: # Check if the react-file-upload version already exists on npm - name: Check Version Existence - id: check_version + id: check_react_version run: | - if npm show @canopassoftware/react-file-upload@1.2.0; then + if npm show @canopassoftware/react-file-upload@1.1.36; then echo "Version already published. Skipping npm publish." - echo "::set-output name=skip_publish::true" + echo "::set-output name=skip_react_publish::true" else - echo "::set-output name=skip_publish::false" + echo "::set-output name=skip_react_publish::false" fi # Publish only if the react-file-upload version check passed - name: Publish to npm - if: steps.check_version.outputs.skip_publish != true - run: npm publish --access public + if: steps.check_react_version.outputs.skip_react_publish != true + run: | + cd react + npm publish --access public env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/react/package.json b/react/package.json index 88f39f1..457e059 100644 --- a/react/package.json +++ b/react/package.json @@ -1,6 +1,6 @@ { "name": "@canopassoftware/react-file-upload", - "version": "1.2.0", + "version": "1.1.36", "description": "Show the preview of file and manage files data to upload", "main": "index.umd.js", "repository": {