From 1100cf58d9470907354f7f636eb89e592b5182e6 Mon Sep 17 00:00:00 2001 From: cp-dharti-r Date: Wed, 10 Jan 2024 18:14:09 +0530 Subject: [PATCH] Manage single file for publish --- .github/workflows/publish.yml | 69 +++++++++++++++++++++++++++++ .github/workflows/react-publish.yml | 38 ---------------- .github/workflows/vue-publish.yml | 38 ---------------- react/package.json | 2 +- vue/package.json | 2 +- 5 files changed, 71 insertions(+), 78 deletions(-) create mode 100644 .github/workflows/publish.yml delete mode 100644 .github/workflows/react-publish.yml delete mode 100644 .github/workflows/vue-publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..65b1df9 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,69 @@ +name: Publish Package to npmjs + +on: + push: + branches: + - main + +jobs: + vue-publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v3 + with: + node-version: "20.x" + registry-url: "https://registry.npmjs.org" + - run: | + cd vue + npm ci + npm run build + + # Check if the version already exists on npm + - name: Check Version Existence + id: check_version + run: | + if npm show @canopassoftware/vue-file-upload@1.0.6; then + echo "Version already published. Skipping npm publish." + echo "::set-output name=skip_publish::true" + else + echo "::set-output name=skip_publish::false" + fi + + # Publish only if the version check passed + - name: Publish to npm + if: steps.check_version.outputs.skip_publish != 'true' + run: npm publish --access public + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + + react-publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v3 + with: + node-version: "20.x" + registry-url: "https://registry.npmjs.org" + - run: | + cd react + npm ci + npm run build + + # Check if the version already exists on npm + - name: Check Version Existence + id: check_version + run: | + if npm show @canopassoftware/react-file-upload@1.2.0; then + echo "Version already published. Skipping npm publish." + echo "::set-output name=skip_publish::true" + else + echo "::set-output name=skip_publish::false" + fi + + # Publish only if the version check passed + - name: Publish to npm + if: steps.check_version.outputs.skip_publish != 'true' + run: npm publish --access public + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/react-publish.yml b/.github/workflows/react-publish.yml deleted file mode 100644 index 93ec4f7..0000000 --- a/.github/workflows/react-publish.yml +++ /dev/null @@ -1,38 +0,0 @@ -name: Publish React Package to npmjs - -on: - push: - branches: - - main - -jobs: - publish: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v3 - with: - node-version: "20.x" - registry-url: "https://registry.npmjs.org" - - run: | - cd react - npm ci - npm run build - - # Check if the version already exists on npm - - name: Check Version Existence - id: check_version - run: | - if npm show @canopassoftware/react-file-upload@1.2.0; then - echo "Version already published. Skipping npm publish." - echo "::set-output name=skip_publish::true" - else - echo "::set-output name=skip_publish::false" - fi - - # Publish only if the version check passed - - name: Publish to npm - if: steps.check_version.outputs.skip_publish != 'true' - run: npm publish --access public - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/vue-publish.yml b/.github/workflows/vue-publish.yml deleted file mode 100644 index b0fc50d..0000000 --- a/.github/workflows/vue-publish.yml +++ /dev/null @@ -1,38 +0,0 @@ -name: Publish Vue Package to npmjs - -on: - push: - branches: - - main - -jobs: - publish: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v3 - with: - node-version: "20.x" - registry-url: "https://registry.npmjs.org" - - run: | - cd vue - npm ci - npm run build - - # Check if the version already exists on npm - - name: Check Version Existence - id: check_version - run: | - if npm show @canopassoftware/vue-file-upload@1.0.6; then - echo "Version already published. Skipping npm publish." - echo "::set-output name=skip_publish::true" - else - echo "::set-output name=skip_publish::false" - fi - - # Publish only if the version check passed - - name: Publish to npm - if: steps.check_version.outputs.skip_publish != 'true' - run: npm publish --access public - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/react/package.json b/react/package.json index b42ce81..4895ff2 100644 --- a/react/package.json +++ b/react/package.json @@ -1,6 +1,6 @@ { "name": "@canopassoftware/react-file-upload", - "version": "1.1.34", + "version": "1.2.0", "description": "Show the preview of file and manage files data to upload", "main": "index.umd.js", "repository": { diff --git a/vue/package.json b/vue/package.json index c3587dc..c5baf48 100644 --- a/vue/package.json +++ b/vue/package.json @@ -1,6 +1,6 @@ { "name": "@canopassoftware/vue-file-upload", - "version": "1.0.5", + "version": "1.0.6", "description": "Show the preview of file and manage files data to upload", "main": "./dist/index.umd.js", "repository": {