diff --git a/.github/workflows/react-publish.yml b/.github/workflows/react-publish.yml new file mode 100644 index 0000000..c11ab17 --- /dev/null +++ b/.github/workflows/react-publish.yml @@ -0,0 +1,37 @@ +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 + - run: npm ci + - run: 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.1.34; 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 new file mode 100644 index 0000000..8c637ae --- /dev/null +++ b/.github/workflows/vue-publish.yml @@ -0,0 +1,37 @@ +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 + - run: npm ci + - run: 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.4; 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/.github/workflows/publish.yml b/react/.github/workflows/publish.yml deleted file mode 100644 index bed1e79..0000000 --- a/react/.github/workflows/publish.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: Publish 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: npm ci - - run: npm run build - - run: npm publish --access public - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/react/package.json b/react/package.json index 4895ff2..b42ce81 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.34", "description": "Show the preview of file and manage files data to upload", "main": "index.umd.js", "repository": { diff --git a/vue/.npmignore b/vue/.npmignore index 01027bf..b343c4a 100644 --- a/vue/.npmignore +++ b/vue/.npmignore @@ -1,32 +1,2 @@ -# Logs -logs -*.log -npm-debug.log* -yarn-debug.log* -yarn-error.log* -pnpm-debug.log* -lerna-debug.log* - -node_modules -.DS_Store -/dist/* -!/dist/output.css -!/dist/style.scss -dist-ssr -coverage -*.local - -/cypress/videos/ -/cypress/screenshots/ - -# Editor directories and files -.vscode/* -!.vscode/extensions.json -.idea -*.suo -*.ntvs* -*.njsproj -*.sln -*.sw? - -src/assets/style.scss +/* +!/dist \ No newline at end of file diff --git a/vue/README.md b/vue/README.md index 64149d2..042bcf7 100644 --- a/vue/README.md +++ b/vue/README.md @@ -117,6 +117,14 @@ OR import { SingleFileUpload, MultipleFileUpload } from '@canopassoftware/vue-file-upload' ``` +### Use default CSS + +- Use `style.css` for UI by importing like, + +```js +import "@canopassoftware/vue-file-upload/dist/style.css" +``` + ### Creating custom UI with file preview - You can customize file uploading UI in `template` block. diff --git a/vue/index.html b/vue/index.html index c714cbe..4e22209 100644 --- a/vue/index.html +++ b/vue/index.html @@ -8,6 +8,6 @@
- +