diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 71b634c79..6928401bb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -61,11 +61,9 @@ jobs: - run: npm run build:prod:jetbrains - - run: zip -r dist-${{ github.event.release.tag_name }}.zip dist - - uses: softprops/action-gh-release@v2 with: - files: dist-jetbrains-${{ github.event.release.tag_name }}.zip + files: dist/dist-*.zip env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -98,7 +96,9 @@ jobs: - uses: actions/upload-artifact@v4 with: name: build - path: dist/ + path: | + dist/ + !dist/dist-*.zip - uses: actions/upload-artifact@v4 with: @@ -110,11 +110,9 @@ jobs: name: dockerfile path: Dockerfile - - run: zip -r dist-web-${{ github.event.release.tag_name }}.zip dist - - uses: softprops/action-gh-release@v2 with: - files: dist-web-jetbrains-${{ github.event.release.tag_name }}.zip + files: dist/dist-*.zip env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/package-lock.json b/package-lock.json index c8fc60019..537343014 100644 --- a/package-lock.json +++ b/package-lock.json @@ -59,6 +59,7 @@ "@types/react-transition-group": "^4.4.5", "@types/semver": "^7.5.6", "@types/uuid": "^9.0.8", + "@types/zip-webpack-plugin": "^3.0.6", "@typescript-eslint/eslint-plugin": "^8.3.0", "@typescript-eslint/parser": "^8.3.0", "babel-loader": "^9.1.3", @@ -90,7 +91,8 @@ "typescript-plugin-styled-components": "^2.0.0", "webpack": "^5.94.0", "webpack-cli": "^5.0.1", - "webpack-merge": "^5.8.0" + "webpack-merge": "^5.8.0", + "zip-webpack-plugin": "^4.0.2" } }, "node_modules/@adobe/css-tools": { @@ -5023,6 +5025,12 @@ "@types/send": "*" } }, + "node_modules/@types/source-list-map": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/@types/source-list-map/-/source-list-map-0.1.6.tgz", + "integrity": "sha512-5JcVt1u5HDmlXkwOD2nslZVllBBc7HDuOICfiZah2Z0is8M8g+ddAEawbmd3VjedfDHBzxCaXLs07QEmb7y54g==", + "dev": true + }, "node_modules/@types/stack-utils": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.3.tgz", @@ -5034,6 +5042,12 @@ "resolved": "https://registry.npmjs.org/@types/stylis/-/stylis-4.2.5.tgz", "integrity": "sha512-1Xve+NMN7FWjY14vLoY5tL3BVEQ/n42YLwaqJIPYhotZ9uBHt87VceMwWQpzmdEt2TNXIorIFG+YeCUUW7RInw==" }, + "node_modules/@types/tapable": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/@types/tapable/-/tapable-1.0.12.tgz", + "integrity": "sha512-bTHG8fcxEqv1M9+TD14P8ok8hjxoOCkfKc8XXLaaD05kI7ohpeI956jtDOD3XHKBQrlyPughUtzm1jtVhHpA5Q==", + "dev": true + }, "node_modules/@types/tough-cookie": { "version": "4.0.5", "resolved": "https://registry.npmjs.org/@types/tough-cookie/-/tough-cookie-4.0.5.tgz", @@ -5046,6 +5060,15 @@ "integrity": "sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==", "dev": true }, + "node_modules/@types/uglify-js": { + "version": "3.17.5", + "resolved": "https://registry.npmjs.org/@types/uglify-js/-/uglify-js-3.17.5.tgz", + "integrity": "sha512-TU+fZFBTBcXj/GpDpDaBmgWk/gn96kMZ+uocaFUlV2f8a6WdMzzI44QBCmGcCiYR0Y6ZlNRiyUyKKt5nl/lbzQ==", + "dev": true, + "dependencies": { + "source-map": "^0.6.1" + } + }, "node_modules/@types/unist": { "version": "2.0.11", "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.11.tgz", @@ -5057,6 +5080,40 @@ "integrity": "sha512-jg+97EGIcY9AGHJJRaaPVgetKDsrTgbRjQ5Msgjh/DQKEFl0DtyRr/VCOyD1T2R1MNeWPK/u7JoGhlDZnKBAfA==", "dev": true }, + "node_modules/@types/webpack": { + "version": "4.41.40", + "resolved": "https://registry.npmjs.org/@types/webpack/-/webpack-4.41.40.tgz", + "integrity": "sha512-u6kMFSBM9HcoTpUXnL6mt2HSzftqb3JgYV6oxIgL2dl6sX6aCa5k6SOkzv5DuZjBTPUE/dJltKtwwuqrkZHpfw==", + "dev": true, + "dependencies": { + "@types/node": "*", + "@types/tapable": "^1", + "@types/uglify-js": "*", + "@types/webpack-sources": "*", + "anymatch": "^3.0.0", + "source-map": "^0.6.0" + } + }, + "node_modules/@types/webpack-sources": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/@types/webpack-sources/-/webpack-sources-3.2.3.tgz", + "integrity": "sha512-4nZOdMwSPHZ4pTEZzSp0AsTM4K7Qmu40UKW4tJDiOVs20UzYF9l+qUe4s0ftfN0pin06n+5cWWDJXH+sbhAiDw==", + "dev": true, + "dependencies": { + "@types/node": "*", + "@types/source-list-map": "*", + "source-map": "^0.7.3" + } + }, + "node_modules/@types/webpack-sources/node_modules/source-map": { + "version": "0.7.4", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.4.tgz", + "integrity": "sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, "node_modules/@types/yargs": { "version": "17.0.33", "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.33.tgz", @@ -5072,6 +5129,15 @@ "integrity": "sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ==", "dev": true }, + "node_modules/@types/zip-webpack-plugin": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/@types/zip-webpack-plugin/-/zip-webpack-plugin-3.0.6.tgz", + "integrity": "sha512-TBaTxxBdA4prtSdKqZncXKnwy8F5dE4btFW3cLqPbhDoRA5fhAi8nJt2CxuMrpG1FtOTSDSoRAwualpfU/BMOw==", + "dev": true, + "dependencies": { + "@types/webpack": "^4" + } + }, "node_modules/@typescript-eslint/eslint-plugin": { "version": "8.9.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.9.0.tgz", @@ -6589,6 +6655,15 @@ "node-int64": "^0.4.0" } }, + "node_modules/buffer-crc32": { + "version": "0.2.13", + "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", + "integrity": "sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ==", + "dev": true, + "engines": { + "node": "*" + } + }, "node_modules/buffer-from": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", @@ -18660,6 +18735,15 @@ "node": ">=8" } }, + "node_modules/yazl": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/yazl/-/yazl-2.5.1.tgz", + "integrity": "sha512-phENi2PLiHnHb6QBVot+dJnaAZ0xosj7p3fWl+znIjBDlnMI2PsZCJZ306BPTFOaHf5qdDEI8x5qFrSOBN5vrw==", + "dev": true, + "dependencies": { + "buffer-crc32": "~0.2.3" + } + }, "node_modules/yn": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", @@ -18681,6 +18765,19 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/zip-webpack-plugin": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/zip-webpack-plugin/-/zip-webpack-plugin-4.0.2.tgz", + "integrity": "sha512-t7GEF8q8l2zcTtrMes5j6/RpkBgIw8ARZmB5jWNksLua1mNa0bVaIVXOU8cFPXnbcFsHjgrLEyRMvLT1HcUiEA==", + "dev": true, + "dependencies": { + "yazl": "^2.5.1" + }, + "peerDependencies": { + "webpack": "^4.0.0 || ^5.0.0", + "webpack-sources": "*" + } + }, "node_modules/zustand": { "version": "4.5.5", "resolved": "https://registry.npmjs.org/zustand/-/zustand-4.5.5.tgz", diff --git a/package.json b/package.json index 0c312eeb8..c0105aef9 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "storybook": "storybook dev -p 6006", "start": "npm run storybook", "build-storybook": "storybook build", - "build:dev": "webpack --progress --config webpack.dev.ts", + "build:dev": "webpack --progress --config webpack.dev.ts", "build:dev:jetbrains": "webpack --progress --config webpack.dev.ts --env platform=JetBrains", "build:dev:web": "webpack --config webpack.dev.ts --env platform=Web", "build:prod": "webpack --progress --config webpack.prod.ts", @@ -64,6 +64,7 @@ "@types/react-transition-group": "^4.4.5", "@types/semver": "^7.5.6", "@types/uuid": "^9.0.8", + "@types/zip-webpack-plugin": "^3.0.6", "@typescript-eslint/eslint-plugin": "^8.3.0", "@typescript-eslint/parser": "^8.3.0", "babel-loader": "^9.1.3", @@ -95,7 +96,8 @@ "typescript-plugin-styled-components": "^2.0.0", "webpack": "^5.94.0", "webpack-cli": "^5.0.1", - "webpack-merge": "^5.8.0" + "webpack-merge": "^5.8.0", + "zip-webpack-plugin": "^4.0.2" }, "dependencies": { "@floating-ui/react": "^0.25.1", diff --git a/webpack.common.ts b/webpack.common.ts index 6cc9def96..275a161df 100644 --- a/webpack.common.ts +++ b/webpack.common.ts @@ -3,7 +3,13 @@ import CopyWebpackPlugin from "copy-webpack-plugin"; import HtmlWebpackPlugin from "html-webpack-plugin"; import path from "path"; import { Configuration as WebpackConfiguration } from "webpack"; +import ZipPlugin from "zip-webpack-plugin"; import { WebpackEnv, appData } from "./apps"; +import packageJson from "./package.json"; + +interface PackageJson { + version: string; +} const getConfig = (env: WebpackEnv): WebpackConfiguration => { const entriesToBuild: Record = env.app @@ -68,7 +74,16 @@ const getConfig = (env: WebpackEnv): WebpackConfiguration => { }); }) ] - : []) + : []), + new ZipPlugin({ + filename: [ + "dist", + (env.platform ?? "").toLocaleLowerCase(), + `v${(packageJson as PackageJson).version}.zip` + ] + .filter(Boolean) + .join("-") + }) ] }; };