diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml index 1774e0b2712..7b711dd9811 100644 --- a/.github/workflows/node.yml +++ b/.github/workflows/node.yml @@ -58,6 +58,14 @@ jobs: run: | npm ci npm run build --if-present + npm run stats --if-present + + - name: Send bundle stats to RelativeCI + uses: relative-ci/agent-action@e92b0c712e5ad0a039faf1026cbe438b8e7fed16 # v2 + with: + webpackStatsFile: ./webpack-stats.json + key: ${{ secrets.RELATIVE_CI_KEY }} + token: ${{ secrets.GITHUB_TOKEN }} - name: Check webpack build changes run: | diff --git a/.github/workflows/relativeci.yml b/.github/workflows/relativeci.yml deleted file mode 100644 index 088e5e64c03..00000000000 --- a/.github/workflows/relativeci.yml +++ /dev/null @@ -1,50 +0,0 @@ -name: Node CI - -on: [push] - -jobs: - build: - - runs-on: ubuntu-latest - - strategy: - matrix: - node-version: [16.x] - - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Read package.json node and npm engines version - uses: skjnldsv/read-package-engines-version-actions@v1.2 - id: versions - with: - fallbackNode: '^14' - fallbackNpm: '^7' - - - name: Set up node ${{ steps.versions.outputs.nodeVersion }} - uses: actions/setup-node@v3 - with: - node-version: ${{ steps.versions.outputs.nodeVersion }} - - - name: Set up npm ${{ steps.versions.outputs.npmVersion }} - run: npm i -g npm@"${{ steps.versions.outputs.npmVersion }}" - - - name: Install dependencies - run: | - npm ci - - - name: build - env: - RELATIVE_CI_KEY: ${{ secrets.RELATIVE_CI_KEY }} - RELATIVE_CI_SLUG: nextcloud/deck - run: | - mkdir -p js - npm run build --if-present -- --profile --json=js/webpack-stats.json - - - name: Send webpack stats to RelativeCI - uses: relative-ci/agent-action@v2 - with: - key: ${{ secrets.RELATIVE_CI_KEY }} - token: ${{ secrets.GITHUB_TOKEN }} - webpackStatsFile: ./js/webpack-stats.json diff --git a/.gitignore b/.gitignore index fea873fb7ac..82cf0c85f93 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,4 @@ cypress/downloads/ /tests/clover.xml /tests/.phpunit.result.cache dist/ +webpack-stats.json diff --git a/package.json b/package.json index a02d1b3382f..fc7111054b6 100644 --- a/package.json +++ b/package.json @@ -16,10 +16,11 @@ "module": "dist/index.js", "main": "dist/index.js", "scripts": { - "dev": "NODE_ENV=development webpack --config webpack.js", + "build": "webpack --node-env production --progress", "dev:package": "vite", - "watch": "NODE_ENV=development webpack --progress --watch --config webpack.js", - "build": "NODE_ENV=production webpack --progress --config webpack.js", + "dev": "webpack --node-env development --progress", + "watch": "webpack --node-env development --progress --watch", + "stats": "webpack --node-env production --json webpack-stats.json", "build:package": "vite build", "lint": "eslint --ext .js,.vue src cypress", "lint:fix": "eslint --ext .js,.vue src cypress --fix", diff --git a/webpack.js b/webpack.config.js similarity index 100% rename from webpack.js rename to webpack.config.js