diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..5cb3e00 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,31 @@ +name: Publish React Package to npmjs + +on: + push: + +jobs: + vue-lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v3 + with: + node-version: "20.x" + - run: | + cd vue + npm ci + npm run lint + + react-lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v3 + with: + node-version: "20.x" + - run: | + cd react + npm ci + npm run lint + + \ No newline at end of file diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..fd127d3 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,69 @@ +name: Publish Package to npmjs + +on: + push: + +jobs: + vue-publish: + runs-on: ubuntu-latest + needs: vue-lint + 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/vue-file-upload@1.0.5; 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 + needs: react-lint + 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.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/react/package-lock.json b/react/package-lock.json index 4408548..66eb8bf 100644 --- a/react/package-lock.json +++ b/react/package-lock.json @@ -1,12 +1,12 @@ { "name": "@canopassoftware/react-file-upload", - "version": "1.1.30", + "version": "1.2.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@canopassoftware/react-file-upload", - "version": "1.1.30", + "version": "1.2.0", "license": "MIT", "dependencies": { "next": "^14.0.4", 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/package.json b/vue/package.json index c5baf48..c3587dc 100644 --- a/vue/package.json +++ b/vue/package.json @@ -1,6 +1,6 @@ { "name": "@canopassoftware/vue-file-upload", - "version": "1.0.6", + "version": "1.0.5", "description": "Show the preview of file and manage files data to upload", "main": "./dist/index.umd.js", "repository": { diff --git a/vue/tailwind.config.js b/vue/tailwind.config.ts similarity index 92% rename from vue/tailwind.config.js rename to vue/tailwind.config.ts index 8efc091..1916fa5 100644 --- a/vue/tailwind.config.js +++ b/vue/tailwind.config.ts @@ -5,7 +5,7 @@ module.exports = { extend: {} }, variants: { - extend: {}, + extend: {} }, plugins: [] }