Skip to content

Commit

Permalink
Manage single file for publish
Browse files Browse the repository at this point in the history
  • Loading branch information
cp-dharti-r committed Jan 10, 2024
1 parent c3730a1 commit 1100cf5
Show file tree
Hide file tree
Showing 5 changed files with 71 additions and 78 deletions.
69 changes: 69 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]; 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/[email protected]; 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 }}
38 changes: 0 additions & 38 deletions .github/workflows/react-publish.yml

This file was deleted.

38 changes: 0 additions & 38 deletions .github/workflows/vue-publish.yml

This file was deleted.

2 changes: 1 addition & 1 deletion react/package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion vue/package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down

0 comments on commit 1100cf5

Please sign in to comment.